473,404 Members | 2,174 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,404 software developers and data experts.

Dialog Box

Hello
If I have created a form which will be used as a dialog box, how do I get
the results passed pack from the dialog box?

I tried this

DialogResult rslt = frm.ShowDialog();

I do not get any compile error, but when I try to use the "rslt" I thought

When I go to check the value, I use statements like:
if (rslt == DialogResult.Cancel)
( return; }

and it does not like these. How do I test the value returned?

One final question...

When I call the constructor for the new form (dialog box), I call it with
my own constructor. I believe I am suppose to call the Original
constructor that has the "Initialize" method in it. How do I call the
original constructor? I think there is a special command for this, I tried
"this.MyConstructor()" but it does not like that and it does not like
"MyConstructor()". So what do I call?

Thanks in advance for your assistance!!!!!!!!!!
Nov 15 '05 #1
1 3905
Jim:

This is in VB, but you can call the whole thing like this...
Select Case MessageBox.Show(sMsg, "Confirm Save As")

Case DialogResult.OK

Case DialogResult.YesNo

Case Else

End Select

In this example, the messagebox sets what the Cancel and Ok buttons are.
However, with your own forms, make sure you set the AcceptButton and
CancelButton or, if you don't, make sure that whatever closes the form
Returns the dialog result you want it to.

What does your constructor look like?
"Jim Heavey" <Ji*******@nospam.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
Hello
If I have created a form which will be used as a dialog box, how do I get
the results passed pack from the dialog box?

I tried this

DialogResult rslt = frm.ShowDialog();

I do not get any compile error, but when I try to use the "rslt" I thought

When I go to check the value, I use statements like:
if (rslt == DialogResult.Cancel)
( return; }

and it does not like these. How do I test the value returned?

One final question...

When I call the constructor for the new form (dialog box), I call it with
my own constructor. I believe I am suppose to call the Original
constructor that has the "Initialize" method in it. How do I call the
original constructor? I think there is a special command for this, I tried "this.MyConstructor()" but it does not like that and it does not like
"MyConstructor()". So what do I call?

Thanks in advance for your assistance!!!!!!!!!!

Nov 15 '05 #2

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

Similar topics

1
by: Prosonman | last post by:
Hi, What is the best way to transfer variables to and from a dialog box? My project consists of a form with a number of controls, lets say three Labels, when a label is clicked it opens a dialog...
23
by: George | last post by:
Is there a way to customize the open file common dialog? I am trying to modify the button text so I can create a delete file common dialog. I need the same functionality of the open file common...
1
by: Carmine | last post by:
I'm currently writing a small program that churns on a repetitive task while displaying a progress & cancel modeless dialog. I've been having problems due to threadlocking, and I was wondering if...
4
by: Alexander | last post by:
Hi, I have written a program that takes on some operations much more time than I expected. As I have seen users clicking wildly on the screen to make something happen, I want to follow the...
6
by: bryanhobson | last post by:
I'm fairly new to c#, and I am just trying to work out how a 'properties' dialog works. Currently in my code, I have an object represented by the class 'Dog'. The dog object has several...
4
by: ronenk | last post by:
I have this code to load an authentication form once my app is loaded. I want the authentication form to be closed if a user is authenticated successfully and to give the option to close app on his...
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
11
by: Zytan | last post by:
I have created a new form from the main form. When I close the main form with the 'x' close button, its Form.FormClosed event is run, but not the dialog's. Is this normal? It is ok /...
0
by: Moezzie | last post by:
So ive got a bit of a problem here. Ive been searching the net about this for quite some time now but i just cant seem to figure out how to open a dialog that ive made in QtDesigner. Of corse i...
11
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have...
0
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
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?
1
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.