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?
C#.NET Programming

Avatar of undefined
Last Comment
pvginkel

8/22/2022 - Mon
pvginkel

Try opening form2 in this way (from form1):

form2.ShowDialog(this);
ASKER
Adnan

but then aplication  dissapears from Cntrl-Tab meny......??
if i use form2.ShowDialog(this);
pvginkel

Could you enable the setting ShowInTaskbar in the properties for the form?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER
Adnan

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
pvginkel

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question