Hi.
I need your help please..
I developed a form in Visual C# with a button on it. When I click that button, a sub form appears. Now I want that without processing or filling this sub form, user couldn't access the main form, this main form must be locked or somewhat else... waiting for your reply...
Loading
Augustin JianuPosted Apr 21, 2010, 6:43 AM
private void button1_Click(object sender, EventArgs e)
{
SubForm sf = new SubForm();
sf.ShowDialog();
}
In the SubForm, on the FormClosing event you should have:
private void SubForm_FormClosing(object sender, FormClosingEventArgs e)
{
// if the user didn't fill all the data needed on the subForm you don't allow him to close the subForm
if( ! isAllDataComplete() )
e.Cancel = true;
}