473,382 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

form.showDialog() does not work properly

Hi

Iam running form2 from form1.
But as it was in many my previous applications, now the form2 doesn't
overlapp form1. It means that i can select form1 without even closing form2.

Here's sample code:

if (MessageBox.Show("Button is not recognized. Would you
like to add function to this button?", "New Button detected",
MessageBoxButtons.YesNo,
MessageBoxIcon.Information) == DialogResult.Yes)
{
Form2 form2 = new Form2();
form2.Button = "b" + t;
form2.ShowDialog();

Fill_DataGrid();
}
May 18 '06 #1
2 4398
"PiotrKolodziej" <pi*************@gmail.com> wrote:
But as it was in many my previous applications, now the form2 doesn't
overlapp form1. It means that i can select form1 without even closing form2.
That's because the form isn't parented.
form2.ShowDialog();


You want the other ShowDialog, the one that takes a parent:

form2.ShowDialog(form1);

-- Barry

--
http://barrkel.blogspot.com/
May 18 '06 #2
Thanks. It works
May 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Harvey | last post by:
Hello: I am trying to use Autosize=true on a long string and it extends off of my form, rather than increasing the number of lines of the Label as the documentation says it should do. Would...
1
by: Mike | last post by:
Hi, I'm new to ASP and can't get this form to work. It's a simple page that draws a calendar for the current month and then you can select a new month and it draws the new calendar. It works...
2
by: peshrad | last post by:
Hi ! Is there anybody who knows (if possible, by theory and practice) what sense it makes to hand over an owner to Form.ShowDialog ? I cannot close/minimize the owning window while the dialog...
3
by: Ivan Weiss | last post by:
I have been using form.show to display my forms yet I see a lot of people using form.Showdialog. What are the differences and when is one better than the other or are they the same...? -Ivan...
4
by: Jm | last post by:
Hi all Im not sure of the best way to be displaying my forms and just want a bit of clarification. Being only recently moved to vb.net im still used to the old vb6 form.show method, now under...
1
by: Frank Rizzo | last post by:
I am not grokking the difference between Form.ShowDialog() and Form.ShowDialog(this). I have a form (parent form) that kicks off a modal dialog using Form.ShowDialog(). The modal dialog has a 3rd...
0
by: Joe | last post by:
Hi, I have a form that I want to use to enter data only. The first field on the form is a date field. I created a macro to open the form in data mode add. When I click on the macro name to...
2
by: Jetean | last post by:
Hi: I search through this forums and google around about this Form.ShowDialog(): I'm unable to make the event at Child Form stop running and It looks like the child Form is still "Alive": ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.