G
Guest
Hi all,
I'm creating a MDI program, so far when it runs, it shows a dialog box for
logging in (modal dialog form with acceptbutton/cancelbutton set, accept
button validates username and password). After receiving the DialogResult if
all is OK I make a treeview visible (that is docked to left) and load the
navigation options into it. The treeview has a method set for on key up so
that if the key pressed is the enter key, it opens the relavent child form.
Hopefully your with me so far... my problem is that when I press enter to
login from the 'Login' dialogbox the treeview is executing the on keyup event
from the same keypress and showing the first child form option on the
treeview (whatever that maybe- different depending on user). How can I stop
this?
Code is a little like this (wont put it all take too long):
onMDIMainFormLoad(object sender........
{
if (LogonForm.ShowDialog(this)== DialogResult.OK)
{
//Only returns ok if login successfull
LoadNavigationOptionsIntoTreeView();
treeView1.Visible= true;
}
}
treeView1_KeyUp(obj........
{
if (e.KeyCode== Keys.Enter)
{
OpenChildForm(treeView1.SelectedNode);
}
}
Thanks
Gav
I'm creating a MDI program, so far when it runs, it shows a dialog box for
logging in (modal dialog form with acceptbutton/cancelbutton set, accept
button validates username and password). After receiving the DialogResult if
all is OK I make a treeview visible (that is docked to left) and load the
navigation options into it. The treeview has a method set for on key up so
that if the key pressed is the enter key, it opens the relavent child form.
Hopefully your with me so far... my problem is that when I press enter to
login from the 'Login' dialogbox the treeview is executing the on keyup event
from the same keypress and showing the first child form option on the
treeview (whatever that maybe- different depending on user). How can I stop
this?
Code is a little like this (wont put it all take too long):
onMDIMainFormLoad(object sender........
{
if (LogonForm.ShowDialog(this)== DialogResult.OK)
{
//Only returns ok if login successfull
LoadNavigationOptionsIntoTreeView();
treeView1.Visible= true;
}
}
treeView1_KeyUp(obj........
{
if (e.KeyCode== Keys.Enter)
{
OpenChildForm(treeView1.SelectedNode);
}
}
Thanks
Gav