?
Solved

Showdialog

Posted on 2016-11-23
8
Medium Priority
?
46 Views
Last Modified: 2016-11-23
Hello,
When a form2 is shown with showdialog  it disables the form1.
How can I disable the form but enable 3 buttons on form1.

Cheers
0
Comment
Question by:RIAS
  • 4
  • 4
8 Comments
 
LVL 20

Expert Comment

by:darbid73
ID: 41898967
Are you trying to show a msgbox or a form? Are you using Win Forms or WPF?

for a msgbox you cannot show it modeless. You could create a new Thread and show the msgbox in that thread.  You would then need to "block" usage of form2 but form1 would be usable.

Otherwise if you have a form then Form.Show will make it modeless.

Here are some examples of Modal and Modaless
0
 

Author Comment

by:RIAS
ID: 41898990
Hello,
i am using vb.net desktop app.
Modal is fine but,how can make 3 buttons on my main form enabled?
0
 
LVL 20

Expert Comment

by:darbid73
ID: 41898997
You will have to make make sure the the whole form is enabled (meaning there is nothing modal affecting it) and then disable everything on the form except the 3 buttons.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:RIAS
ID: 41899005
whole form is enabled (meaning there is nothing modal affecting it)
How can i do this?
When i declare
form2.showdialog ,
 the parent form is disabled ,don't know how can i enable it and follow your instruction
0
 
LVL 20

Expert Comment

by:darbid73
ID: 41899009
There may be other ways of doing what you want.

You need to use
form2.Show

Open in new window

0
 

Author Comment

by:RIAS
ID: 41899010
showdialog is perfect,i have previously tried show.But only want three buttons to be enabled
0
 
LVL 20

Accepted Solution

by:
darbid73 earned 2000 total points
ID: 41899028
There is no ready made way of doing this. You will have to do it yourself.

1. To enable only 3 buttons on a form you must DISABLE all other controls.
2. If your form1 is blocked by calling showdialog then you cannot call it.
3. use Show, disable form2 and disable everything on form1 except your 3 buttons.

NUmber 3 is maybe not the best solution but it is the best based on your limited information so far.
0
 

Author Closing Comment

by:RIAS
ID: 41899281
Thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question