B
Brian Henry
Hi,
I have a bunch of forms in a DLL that I call from my main application. The
one form is a login form, and I have the tab order set in the order I want
it (password box first, then ok button then cancel button then database
selection combo box then user name text box, then back to password text box)
now the password, user name and database entry's are in a group box frame.
the buttons (Ok and Cancel) are outside the group frame.
Now that the tab order is set, I want to set focus by default to the
password text box. The user name is entered automaticly by the system as per
the current user logged into active directory on the system. (of course the
user can change who logs in by changeing the text box). When I do this in
the load event
txtPassword.PasswordChar = bdbGeneral.PASSWORDCHAR ' make the better looking
mask character (chrW is unicode characters)
' set live as the default
Me.cboDatabase.value = settings.ReadSetting("initialDatabase")
Me.txtPassword.Text = "password"
Me.txtUser.Text =
System.Security.Principal.WindowsIdentity.GetCurrent.Name().Substring(System
..Security.Principal.WindowsIdentity.GetCurrent.Name.IndexOf("\") + 1)
Me.txtPassword.Focus()
now, when I run the form, txtpassword does not have focus. The focus is
starting on the cancel button. I do have the cancel button as the form
default cancel button and the ok button as the forms default acept button.
What is causeing this and how would i fix it? I thought using the focus
method was going to give teh textbox gocus.... it has in the past.. thanks
I have a bunch of forms in a DLL that I call from my main application. The
one form is a login form, and I have the tab order set in the order I want
it (password box first, then ok button then cancel button then database
selection combo box then user name text box, then back to password text box)
now the password, user name and database entry's are in a group box frame.
the buttons (Ok and Cancel) are outside the group frame.
Now that the tab order is set, I want to set focus by default to the
password text box. The user name is entered automaticly by the system as per
the current user logged into active directory on the system. (of course the
user can change who logs in by changeing the text box). When I do this in
the load event
txtPassword.PasswordChar = bdbGeneral.PASSWORDCHAR ' make the better looking
mask character (chrW is unicode characters)
' set live as the default
Me.cboDatabase.value = settings.ReadSetting("initialDatabase")
Me.txtPassword.Text = "password"
Me.txtUser.Text =
System.Security.Principal.WindowsIdentity.GetCurrent.Name().Substring(System
..Security.Principal.WindowsIdentity.GetCurrent.Name.IndexOf("\") + 1)
Me.txtPassword.Focus()
now, when I run the form, txtpassword does not have focus. The focus is
starting on the cancel button. I do have the cancel button as the form
default cancel button and the ok button as the forms default acept button.
What is causeing this and how would i fix it? I thought using the focus
method was going to give teh textbox gocus.... it has in the past.. thanks