473,386 Members | 1,766 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.

DialogResult

sorry, I have a stupid question
I open a form with ShowDialog because I need a value from this form.
how do I set the result value of this "dialog" form?
DialogResult property do not accept any value.

Tx

Nick

Nov 21 '05 #1
2 1502
Hi Angel Soft!

"Angel Soft" schrieb
sorry, I have a stupid question
I open a form with ShowDialog because I need a value from this form.
how do I set the result value of this "dialog" form?
DialogResult property do not accept any value.


Read this:
http://www.knowdotnet.com/articles/acceptcancel.html

Cheers

Arne Janning
Nov 21 '05 #2
"Angel Soft" <an*******@angelsoft.ro> schrieb:
I open a form with ShowDialog because I need a value
from this form.
how do I set the result value of this "dialog" form?
DialogResult property do not accept any value.


Add an additional property to the form that holds the return "value".
Inside your form you set the property and check the property when
'ShowDialog' returns.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #3

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

Similar topics

1
by: Roman Muntyanu | last post by:
Hi all I have modal dialog that has DialogResult=Ok button I need to check some data in dialog when I click Ok before returning to calling form. Any tips would be appreciated Thanks, Roman
1
by: Beeeeeeeeeeeeves | last post by:
Something tells me that there is a single-method way of accomplishing this. When you click the button that is designated as the cancel button, the form automatically acts as if it has been dismissed,...
5
by: Daniel | last post by:
what do you have to do in a C# dialog so that it returns to ShowDialog as DialogResult.OK ?
2
by: steve bull | last post by:
I have built what I think should be a dialog box. It contains 4 tabbed panes for generating a range of colors. Each tabbed pane consists of a panel with all the widgets on them including the OK and...
7
by: Frank Maxey | last post by:
I am fairly new to VB.Net and am having a curious problem. I have an entry dialog form called from a main form. The calling form needs to check the DialogResult field for an OK response. In...
2
by: dm1608 | last post by:
I'm opening my own form and doing something like: If dlgDirectory.ShowDialog() = DialogResult.OK Then .... End If When I compile the project, I can a warning for the line saying: Access of...
11
by: rk | last post by:
According to the docs, I would expect to check the result of an OpenFileDialog in a VS 2005 CLR Windows Forms application this way: if (openFileDialog1->ShowDialog()== DialogResult::OK) ...
1
by: Bill Cart | last post by:
I am trying to work with 2 forms. If I set the ModalResult of a button on the 2nd form it works OK. If I try to assign the result and then return it does not return the value I set. 1st Form...
7
by: Masterfrier | last post by:
Hi there! in my app, i open a Dialog, in this dialog i use the FileOpenDialog, when i click on 'Ok' or 'Cancel' in my FileOpenDialog, it automatically closes the parent dialog, with a...
2
by: WP | last post by:
Hello, I making and Windows Forms program and I have a dialog with two buttons. I have set the DialogResult property for these buttons to DialogResult.OK and DialogResult.No, respectively (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:
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: 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: 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
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,...

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.