How to make InputBox text UseSystemPassword?

qadeer37

Well-known member
Joined
May 1, 2010
Messages
63
Location
Hyderabad,pakistan
Programming Experience
1-3
Dim Password As String = InputBox("Confirm Password")

If txtGetPW.Text = Password Then
objCustomerADO.AddCustomer(CType(txtGetCID.Text, Integer), txtGetFN.Text, txtGetLN.Text, txtGetEM.Text, CType(txtGetBL.Text, Decimal), txtGetPW.Text)
Else
MessageBox.Show("Password don't match hence Customer can not be added", "MyShop", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
 
You don't. Make a form or use the dialog box template to make one. Then on the new form you can use the Textbox control in Password mode.

VB.NET:
Dim frmGetPassword as New MyGetPasswordDialog()

If frmGetPassword.ShowDialog() == DialogResult.OK Then
     Dim Password As String = frmGetPassword.txtPasswordEntered.Text
     If txtGetPW.Text = Password Then
          objCustomerADO.AddCustomer(CType(txtGetCID.Text, Integer), txtGetFN.Text, txtGetLN.Text, txtGetEM.Text, CType(txtGetBL.Text, Decimal), txtGetPW.Text)
     Else
          MessageBox.Show("Password don't match hence Customer can not be added", "MyShop", MessageBoxButtons.OK, MessageBoxIcon.Error)
     End If
End If

'If the dialog box returns anything other than OK you can assume the user canceled whatever they were doing 
' and then not add the customer ....
 
Back
Top