Select Page
Codoid Blog

Mask Input Value

Being a leading QA Company, we write blogs on all prominent software testing topics and tools using our real-world experience. So stay sharp by subscribing to our Newsletter.

Listen to this blog

Since this is the very first article in this blog, we would like to start it with well known
masking input value technique using Dot Net Factory.

Code

Dim oForm, oTextBox, oCloseButton, oPoint, inX, inY

Set oForm=DotNetFactory.CreateInstance("System.Windows.Forms.Form","System.Windows.Forms")
Set oTextBox=DotNetFactory.CreateInstance("System.Windows.Forms.TextBox","System.Windows.Forms")
Set oCloseButton = DotNetFactory.CreateInstance("System.Windows.Forms.Button", "System.Windows.Forms")
Set oPoint = DotNetFactory.CreateInstance("System.Drawing.Point", "System.Drawing", inX,inY) 

With oPoint
.X=180
.Y=33
End with

With oCloseButton 
.Location = oPoint
.Text = "Close"
End with

With oPoint
.X=10
.Y=35
End with

With oTextBox
.Location = oPoint
.Width=160
.UseSystemPasswordChar=True 
End with

With oForm
.Height=120
.width=275
.text="Masked Inputbox"
.CancelButton = oCloseButton
.Controls.Add oCloseButton
.Controls.Add oTextBox
.MaximizeBox=False
.MinimizeBox=False
End with

oForm.ShowDialog

Msgbox oTextBox.Text

Set oForm=Nothing
Set oTextBox=Nothing
Set oCloseButton=Nothing
Set oPoint=Nothing
  

 

Synopsis

After executing the above code, you will get Input Dialog as shown below. Enter value in the textbox control and click on Close button.

Masked Input Box - Mask Input Value

Comments(0)

Submit a Comment

Your email address will not be published. Required fields are marked *

Talk to our Experts

Amazing clients who
trust us


poloatto
ABB
polaris
ooredo
stryker
mobility