Questions tagged [dialogresult]

DialogResult is returned by dialogs after dismissal. It indicates which button was clicked on the dialog by the user. It is used with the MessageBox.Show method. It is a value. It can be switched upon and tested in an if-statement.

DialogResult is returned by dialogs after dismissal. It indicates which button was clicked on the dialog by the user. It is used with the MessageBox.Show method. It is a value. It can be switched upon and tested in an if-statement.

97 questions
1
vote
1 answer

How to return an IObservable from ShowDialog

I'm looking to create an extension method with the following signature: public static IObservable ShowDialog(this Form form); I don't know how to get this to work. This is what I have so far: Task task =…
potato
  • 41
  • 6
1
vote
1 answer

How do bind a button to an OK Dialog result with winforms

I Have a Form that I have opened up as a dialog. On the Form I have a cancel and a correct button, I need to get the positive feedback from the form when the user selects the correct button. How would I go about linking the correct button to the OK…
Sheenie
  • 143
  • 2
  • 9
1
vote
1 answer

I'm trying to start a form with ShowDialog and it returns DialogResult.Cancel. Why is this?

Progress progress = new Progress();//progress.DialogResult is OK. if (progress.ShowDialog() != DialogResult.OK) {//progress.DialogResult is cancel. throw new ArgumentException(); } In the debugger it says that the result is…
trinalbadger587
  • 1,905
  • 1
  • 18
  • 36
1
vote
1 answer

C# How to make async MessageBox that returns DialogResult?

My MessageBox is async, but how can I return DialogResult? Here is my code: class AsyncMessageBox { private delegate void ShowMessageBoxDelegate(string strMessage, string strCaption, MessageBoxButtons enmButton, MessageBoxIcon enmImage); //…
KotkaZ
  • 41
  • 1
  • 1
  • 8
1
vote
1 answer

Default DialogResult for MessageBox after timeout

I need to create a custom MessageBox in C# Framework 3.5 which displays some MesageBoxButtons, and returns the DialogResult value. If there is no user reaction, after a certain timeout time, the MessageBox should close, returning null. I followed…
AlexGuevara
  • 932
  • 11
  • 28
1
vote
1 answer

DialogResult in F#

Trying to retrieve a DialogResult from a window in a MVVM app, I stumbled on this previous question. After implementing the suggested changes, the sample looks like: type DialogCloser() = static let DialogResultProperty = …
Funk
  • 10,976
  • 1
  • 17
  • 33
1
vote
2 answers

How to return the value by DialogResult.OK by not to closing the form

I've created a printing tools with the print preview. The print preview is made by form. I would like to let user to click the print button to print the doc while the preview form is not closing. How can I return the DialogResult.OK to the printing…
newstartgirls
  • 281
  • 1
  • 8
  • 19
1
vote
1 answer

when dialog result for form get return

hi i have on object (serverconnection from sqlserver Managament object ) i need send this object to other form to configure connection option and connect so object return but when i send this object to form2 how return it or when i use…
maysam
  • 41
  • 3
1
vote
2 answers

How to determine if Window was launching as a modal using ShowDialog

I have a WPF Window created. I have some cases where i want to display it using ShowDialog() and others just using Show(). For the ShowDialog() i want to set the DialogResult which all works fine, however if the window is launched using Show() and…
CathalMF
  • 9,705
  • 6
  • 70
  • 106
1
vote
2 answers

How to wait for a response from a wpf mvvm popup

I've searched but cannot find an answer to this question, and maybe that means there is a better way to do what I'm attempting. In a WPF application, using MVVM design pattern: I've created a UserControl that is a box. This popup box has two…
nycfdtd
  • 404
  • 7
  • 23
1
vote
4 answers

C# MessageBox with DialogResult giving "No overload for method 'Show' takes '3' arguments"

I am developing an application for Windows CE using Visual Studio 2008. Code: private void cmdLogOn_Click(object sender, EventArgs e) { if (loginStatus == false) { DialogResult dialogresult =…
1
vote
1 answer

How can I ensure closed dialogs are unregistered from INPC events?

I have an MVVM-Light based WPF application, with a dialog service (called WindowManager) that opens up dialog windows bound to pre-initiated dialog view-models, like this: private enum ViewModelKind { PlanningGridVM, InputDialogVM, …
Riegardt Steyn
  • 5,431
  • 2
  • 34
  • 49
1
vote
1 answer

DialogResult Infinite Loop

So I have this project at school to create a game "Guess the number". I am trying to loop a DialogResult using a switch statement and a while loop. I tried many possibilities but I go into a infinite loop. Just to know I am a beginner.I would really…
0
votes
2 answers

Windows Forms DialogResult

in the following code I want to get the dialog result of a Form but it's not saved to my variable... why? My code: public void xyz() { var dialogResult = new DialogResult(); if (booleanVariable) { var form1 = new Form1(); …
kyjan
  • 291
  • 1
  • 4
  • 11
0
votes
1 answer

DialogResult handling

I have a question about accessing dialogdata from wpf/ I have a ProgressDialog :System.Windows.Window And I am calling it in OnButtonClick like this: void OnButtonClick(object sender, RoutedEventArgs e) { …
Papa John
  • 3,764
  • 3
  • 26
  • 23