473,811 Members | 3,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1531
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*******@ange lsoft.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
3364
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
9226
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, but for the OK, you have to put in its click handler: private void btnOK_Click(object sender, System.EventArgs e) { DialogResult = DialogResult.OK; Hide(); } Is there a better way of doing it?
5
3701
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
17747
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 Cancel buttons. These buttons have to be on the panels themselves so that they can create the color range from the current settings on the panel and return the result via a delegate to the main dialog form. The problem I have is that the OK...
7
2649
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 my button service in the dialog form, I have: Private Sub btnSave_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnSave.Click
2
7551
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 shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
11
2662
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) However, this does not work, and I have to use: if (openFileDialog1->ShowDialog()== System::Windows::Forms::DialogResult::OK)
1
2362
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 (calling form) DeliveryInfo DeliveryFrm = new DeliveryInfo(Convert.ToInt32(this.uniqueIDTextBox.Text)); DialogResult result;
7
5591
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 DialogResult.Cancel??? I have overloaded the ShowDialog to accept parameters in the 'Parent' Dialog main Code ...Calling Parent Dialog
2
6997
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, these buttons are not labelled "OK" and "No"). Settting this property is very convenient, I don't need to write any code determining what should happen when one of these buttons is clicked. Anyway, now I need to add a third button and I guess I...
0
9607
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10408
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10137
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9211
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7673
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3874
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3026
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.