webbiz
Member
- Joined
- Oct 15, 2011
- Messages
- 21
- Programming Experience
- 10+
I'm just learning to program in C# via VS2010.
I've added a menu strip and added a menu item (Load Data).
For Load Data, I want to open another form (DataLoad) that holds the focus till I'm done using it.
My understanding is that it needs to be MODAL so that if I click on the form that has the menu that called it that it will not switch focus over to it.
Here is my code:
private void loadDataToolStripMenuItem_Click(object sender, EventArgs e)
{
DataLoad frmLoadData = new DataLoad();
frmLoadData.Show(this);
}
When I run the program and then click on the menu Load Data, it brings up my DataLoad form as expected.
However, if I click on my main form (that contains the calling menu item) the focus switches back to it.
Not what I want.
Apparently adding "this" was not enough. Just can't find an answer to this.
Sorry if this is the most basic question ever.
TIA
I've added a menu strip and added a menu item (Load Data).
For Load Data, I want to open another form (DataLoad) that holds the focus till I'm done using it.
My understanding is that it needs to be MODAL so that if I click on the form that has the menu that called it that it will not switch focus over to it.
Here is my code:
private void loadDataToolStripMenuItem_Click(object sender, EventArgs e)
{
DataLoad frmLoadData = new DataLoad();
frmLoadData.Show(this);
}
When I run the program and then click on the menu Load Data, it brings up my DataLoad form as expected.
However, if I click on my main form (that contains the calling menu item) the focus switches back to it.
Not what I want.
Apparently adding "this" was not enough. Just can't find an answer to this.
Sorry if this is the most basic question ever.
TIA