Hi
In WinForms, I want to navigate from a form to another one. The problem is that he doesn't want to close the first Form when I do that.
Code
frmRecieve oForm = new frmRecieve ();
oForm.ShowDialog();
this.Close();
Anyone who can help? Thanks
5 2007
If u don't want to close first form(form1) when u navigate to onther form(form2)..
Write down following code.
Form2 frm=new Form2();
frm.showDialog();
This code work perfectly.Althought form2 display on screen but it is modal so u can't navigate to from1 untill u close from2.
Bye...Take Care....Enjoy Coding
Hi
In WinForms, I want to navigate from a form to another one. The problem is that he doesn't want to close the first Form when I do that.
Code
frmRecieve oForm = new frmRecieve ();
oForm.ShowDialog();
this.Close();
Anyone who can help? Thanks
-
frmRecieve oForm = new frmRecieve ();
-
//oForm.ShowDialog();
-
//if you change this line to Show(), the forms can be switched back and forth.
-
oForm.Show();
-
//this.Close();
-
//skip the Close() part to not close the current form.
-
Also, if you want to be able to switch back and forth, but not be able to spawn multiple forms, set frmRecieve oForm as a public member of the parent form.
Then, when you want to bring it up, -
if(oForm == null || oForm.IsDisposed)
-
{
-
oForm = new frmRecieve();
-
oForm.Show();
-
}
-
else
-
oForm.Focus();
-
-
frmRecieve oForm = new frmRecieve ();
-
//oForm.ShowDialog();
-
//if you change this line to Show(), the forms can be switched back and forth.
-
oForm.Show();
-
//this.Close();
-
//skip the Close() part to not close the current form.
-
Also, if you want to be able to switch back and forth, but not be able to spawn multiple forms, set frmRecieve oForm as a public member of the parent form.
Then, when you want to bring it up, -
if(oForm == null || oForm.IsDisposed)
-
{
-
oForm = new frmRecieve();
-
oForm.Show();
-
}
-
else
-
oForm.Focus();
-
Thanks, but I want to close the first form, but he doesn't do that.
Thanks, but I want to close the first form, but he doesn't do that.
Oh, I misunderstood that, sorry. I don't know off the top of my head. Let me think about it.
Oh, I misunderstood that, sorry. I don't know off the top of my head. Let me think about it.
I Finally figured it out
FrmTest oForm = new FrmTest();
oForm.ShowDialog();
this.Dispose(FALSE);
Thx anyway
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jean-Fran?ois Lacrampe |
last post by:
Hello,
I want to write a _very_ simple text parser that would replace a
string like:
"This is text with /italics/, *bold* and _underline_."
and generate automatically something like this:
...
|
by: Eric Cadwell |
last post by:
We're running Load Runner to test a large 1.0 based WinForms application.
I'm getting the following exception when opening and closing a form 400 -
450 times. The form contains several controls and...
|
by: MJEASSOC |
last post by:
I need some help with closing a popup window. I'm making an online portfolio,
that has one base page with text and thumbnails. When a user clicks on a thumb,
a new window opens containing a larger...
|
by: N. Graves |
last post by:
Hi,
I want to have a Search Dialog box that has several text box and
fields to build a search and display the results in a form. I can do
everything that I need to if I us a report but I would...
|
by: Greg |
last post by:
On my report I want to have an opening balance signifying all transactions
up to the month selected
and detailed transactions for the month selected
and then a closing blance.
I'm perpelexed...
|
by: iwdu15 |
last post by:
how can i open a file i saved and place the info into different text boxes?
|
by: Sam |
last post by:
Hello All,
We want our Call Service Representatives to be able to go back and view
all the records in a table on a form. When closing and re-opening the
form the form starts out as record 1 of 1...
|
by: Salad |
last post by:
I have a form that opens another (intermediary) form. The user selects
an option on the intermediary form and it opens another form and the
intermediary form is closed. Ex:
From MainForm...
|
by: Anthony P. |
last post by:
Hello Everyone,
I'm pretty new to VB.NET and I've run into a snag that I'm not really
sure how to get around. I'm writing an application that shows a
splashscreen, then a license agreement. When...
|
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= |
last post by:
I am (still) relatively new to Windows applications, most of my experience
has been Web based, and I am confused about what exactly happens when the
Main() method is called and how to manipulate...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |