How to create Password TextBox Using ActiveX Control
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.