473,386 Members | 1,785 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,386 software developers and data experts.

Simple focus Q

Form1() has a selection menu for the user. Form1() calls Form2() with menu
selections. Form2 opens a Crystal Report viewer. How do I this.Close()
the Form1 properly so the user doesn't have access to the previous selection
menu when the CR viewer opens. Currently, the menu stays open behind the
viewer. Or, am I missing something.

//button on Form1
private void okButton_Click(...)
{
Form2 form2 = new Form2(selections);
form2.ShowDialog(); //allows CR viewer to open
}
Dec 30 '05 #1
4 1067
I wouldn't try to Close the first form, as such. Just do a this.Hide()
to make it invisible while the viewer is up, then this.Close() it after
the form2.ShowDialog() call returns.

Dec 30 '05 #2
Thanks Bruce appears to work fine. I thought I looked for Hide()

Anyways, can I test for a showdialog() returns. I ask because I have a dll
that won't close ...sometimes .. and it remains open on the server and I have
to go to the server to close/end it. There are no threads.

Steve

"Bruce Wood" wrote:
I wouldn't try to Close the first form, as such. Just do a this.Hide()
to make it invisible while the viewer is up, then this.Close() it after
the form2.ShowDialog() call returns.

Dec 30 '05 #3
Hmm. I assume that you're using WebForms and ASP.NET. In that case I
can't help you... I'm strictly a WinForms guy for the present. Maybe
someone else can jump in?

Dec 30 '05 #4
Oh, hey... I just had an idea.

Are you doing a Dispose() after ShowDialog() returns?

form2.ShowDialog();
.... get whatever information you need from form2 ...
form2.Dispose();

? That could account for your DLL being left open, if form2 uses it.

Dec 30 '05 #5

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

Similar topics

7
by: Bruce Duncan | last post by:
I know this should be simple...but for some reason my brain isn't working. I want my users to enter a the date in three seperate boxes. After the users enters in two digits for the month I want...
6
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I donīt know much javascript so I wrote a very simple one to validate a form I have on my webpage. ...
6
by: nizar.jouini | last post by:
I have web page that contains two links. link "a" and link "b". When I click on "a" a small window should pop up. when I click on "b" another small window should pop up. So what you should see now...
3
by: Marc Llenas | last post by:
Hi there, I'm stuck on a validation function for a form and I cannot figure out what the problem is. The page is in ASP. Any ideas? The function being called is: <script...
11
by: greg.scharlemann | last post by:
I've been playing with this form validation method for a while and have tried an array of things but haven't had any luck with a couple items. 1. The validateForm() function doesn't detect when...
4
by: Rodrigo Ferreira | last post by:
Anyone uses the simple button component from DevExpress?
8
by: Rob | last post by:
It used to be "After Update" in Access, but in vb.net... After a user enters something into a textbox and presses the Enter button, I want the focus to move to another texbox. Which one do you...
10
by: blaine | last post by:
Hey everyone! I'm not very good with Tk, and I am using a very simple canvas to draw some pictures (this relates to that nokia screen emulator I had a post about a few days ago). Anyway, all is...
0
rnd me
by: rnd me | last post by:
Purpose: Allows you to create "presets" for text form inputs. "Lightweight and simple to setup, it adds a lot of convenience for ~1kb of code." Only one function, two parameters: First...
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: 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...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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 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.