Skip to Content
Author's profile photo Former Member

How to create Password TextBox Using ActiveX Control

In this blog I would like to demonstrate feature of ActiveX control can be used from SDK.

Most common problem for SAP B1 developers who would like create secure entry of passwords:  how can make a password box or textbox with masked with * characters.

Information for MS Office users: Microsoft Forms 2.0 library contains ActiveX objects. For distribution of Forms 2.0 library please see article KB224305 at Microsoft website.

1. Add the Microsoft Forms 2.0 Library to Your Visual Studio Project

In a Microsoft Visual Studio
a) Click on Project/Add Reference Menu
b) Select COM tab, and find and select the Microsoft Forms 2.0 Library from the list.

c) Click on OK button to close the Add references window

2. Declaration of Global Object for ActiveX Password Box

As a next step you should declare a Global object inside your addon class for ActiveX Password Textbox. (local object is not working based on my tests).
The Microsoft Forms 2.0 Library assembly namespace is Microsoft.Vbe.Interop.Forms.

3. Adding the ActiveX control to your form

At creation of a Form, you can use “Forms.TextBox.1” as the ActiveX ClassId and should assign the previously created Global Object to the object of the ActiveX control.
Also set the property PasswordChar to * , which will mask the entered text.

You can use the oTextBox Global Object to manage the password value.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      This article is really nice!!

      How can i get the classId of others objects?? Because i'm trying to put the object of crystal reports in a user sap form

      Thank you!!

      Author's profile photo Former Member
      Former Member

      It will be your fully qualified object name used in creating COM component. I did the same thing 4 years back and it really work very nicely.