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

what do you have to do in a C# dialog so that it returns to ShowDialog as DialogResult.OK ?

what do you have to do in a C# dialog so that it returns to ShowDialog as
DialogResult.OK ?
Jul 21 '05 #1
2 1206
If it is your own form set this in code:

this.DialogResult = DialogReslt.OK

Or you can set it on a button, by setting the DialogResult property of the
button.

If it is a message box, make sure you have the MessageBoxButton.OK

--
Eric Renken
Demiurge Software LLC
"Daniel" <so*******************@yahoo.com> wrote in message
news:OJ**************@TK2MSFTNGP14.phx.gbl...
what do you have to do in a C# dialog so that it returns to ShowDialog as
DialogResult.OK ?

Jul 21 '05 #2
Daniel,
In addition to the other comments.

I normally set the Button.DialogResult to DialogResult.Ok for buttonOk, then
set Button.DialogResult to DialogResult.Cancel for buttonCancel.

Then I set the Form.AcceptButton to buttonOk and Form.CancelButton to
buttonCancel.

Where buttonOk & buttonCancel are button controls on my form.

Note: buttonOk & buttonCancel can actually be any control that implements
IButtonControl, such as a user control that behaves like a button...

Hope this helps
Jay

"Daniel" <so*******************@yahoo.com> wrote in message
news:OJ**************@TK2MSFTNGP14.phx.gbl...
what do you have to do in a C# dialog so that it returns to ShowDialog as
DialogResult.OK ?

Jul 21 '05 #3

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

Similar topics

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...
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 ?
1
by: steve bull | last post by:
I created a dialog box which runs fine when I call Show() but gives the following unhandled exception when I call ShowDialog(). It crashes when exiting from the menu item callback that invoked it. ...
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...
5
by: pswulius | last post by:
Hey everyone, for reasons I can't explain quickly, I'm developing a completely custom OK/OK_CANCEL dialog, though I think many people would benifit from this knowledge. I basically need to...
9
by: Ale K. | last post by:
What's the best way to make a form return a value.... i want to try to avoid using module variables for doing this... Thanks. Alex.
10
by: GJP | last post by:
Hello. Ive been asked to make my own notepade for college assignment. All ig going well, but i cant get the save to work. I can get Save a (shows dialog box), i can get it to just save too,...
18
by: Dusty Hackney | last post by:
Hello, I am programming in Visual Basic .NET. I have seen examples of creating a login form to use for users to type in their username and password, but I want to accomplish the same thing with...
6
by: wheeto | last post by:
Hi I'm new to vb 2005 and am having problems with save as dialog code, when i go to save a file it returns "file not found" but when it looks at a file on the pc then it will save, can someone...
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.