Link to home
Start Free TrialLog in
Avatar of Adnan
AdnanFlag for Norway

asked on

how to disable access to form1 when form 2 is open...?!

in my runnning application when i open form2 i still have access to form1, how can i stop access to form 1 when form2 is open or running?
Avatar of pvginkel
pvginkel
Flag of Netherlands image

Try opening form2 in this way (from form1):

form2.ShowDialog(this);
Avatar of Adnan

ASKER

but then aplication  dissapears from Cntrl-Tab meny......??
if i use form2.ShowDialog(this);
Could you enable the setting ShowInTaskbar in the properties for the form?
Avatar of Adnan

ASKER

But i dont want to show in taskbar, i just want to not have access to form1 when form2 is open....

i attached my code which open the form2 from form1.....
 if (TestRelation())
            {
                StartingBalance sb = new StartingBalance(myOperator);
                ////set relation name in heading
                sb.RelationName = currentRelationRow.Name;
                sb.LeftName = lblLedger.Text;
                sb.RightName = lblBank.Text;
                sb.Owner = this.ParentForm;
                sb.StartPosition = FormStartPosition.CenterParent;
                //sb.ShowDialog();
                sb.ShowDialog(this);
                //sb.Show(this);
                SetBtnStartingBalance();
            }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of pvginkel
pvginkel
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial