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
2
votes
1 answer

Why is Dialogresult nil?

This never happened to me before. I do have System.Windows.Forms namespace under uses clause and I am able to use DialogResult's properties. Look at the code below. It's where the problem is in my program. if (thewinform.ShowDialog=DialogResult.OK)…
ThN
  • 3,235
  • 3
  • 57
  • 115
2
votes
4 answers

Application Close on DialogResult

I have a C# GUI application. When the user clicks on the red 'X' (for closing the app) I want to show a message and ask if he really wants to close it. I found a solution: DialogResult dialog = MessageBox.Show("Do you really want to close…
Nicky
  • 93
  • 1
  • 4
  • 8
1
vote
1 answer

Process.Start() an executable and return a DialogResult to the caller

When I want to display message I'm calling Message Display sub program(EXE) from my main Program (calling program). I cannot get called exe dialog result to caller. Dim psiProcessInfo As New ProcessStartInfo With psiProcessInfo …
Mark
  • 67
  • 5
1
vote
1 answer

A Button needs to be clicked twice to close a Dialog

I am trying to run a simple code. I have created a Form with a ComboBox (DropDownStyle = DropDown), which is empty in the beginning, it's filled with two when the DropDown is opened. This Form also has 2 Buttons, one of them is the proceedButton…
1
vote
4 answers

Bind a views DialogResult to a ViewModels property?

I am relatively new to WPF, XAML and Data-bindings. I have a view (Window) and a view-model. I have tried to implement the MVVM pattern which means neither the view nor the view-model hold a reference to each other. All data exchange happens via…
Thomas Huber
  • 1,282
  • 1
  • 13
  • 23
1
vote
3 answers

Close form on messagebox answer trouble

I am trying to use this code to close a form on a specific answer of a message box. I keep receiving an error saying that neither Yes nor No belong to DialogResult::. I basically copied this code straight from the MS site, so i have no idea what's…
1
vote
2 answers

How do I pass data from MatDialog => Rxjs Effect => Component?

My component is calling an Action and using @Effect to open the Dialog. The Dialog send the data back to the @Effect. I'm able to see the data using .afterClosed() in the @Effects, but I don't know how to get it to the component using…
CZar
  • 17
  • 3
1
vote
1 answer

Can I use dialogs and DialogResult on a UserControl with WPF?

I've a UserControl and I need to get input from a dialog. However, when I try to do this: AddPassword addPassword = new AddPassword(); if(addPassword.ShowDialog() == == DialogResult.GetValueOrDefault()) { if…
HoBa
  • 3,442
  • 5
  • 26
  • 33
1
vote
1 answer

Start a process with DialogResult c#

I am actually writing a program that creates specific excel files I need, with Microsoft.Office.Interop.Excel. This works fine. My program creates, then safes and close the new excel file (works fine). sheet.SaveCopyAs(path); sheet.Saved = true; …
steffen1994
  • 247
  • 2
  • 12
1
vote
3 answers

C# Button with DialogResult Retry

I'm going to use two buttons that have a DialogResult Retry. When you push the button the winform will hide, do something and it pops-up again. I use the While method for this. But if you have two buttons with a retry this won't work unless you set…
vanlion
  • 111
  • 8
1
vote
3 answers

Automatically clicking OK button in c# app

Morning all, I have a c# app where if you press a start button a dialog box will open and the OK button will be automatically pressed. The problem is I don't know how to do this. The code is below: private void Start_Click(object sender, EventArgs…
Kenny Barber
  • 245
  • 2
  • 11
1
vote
1 answer

How to programmatically change the initial file saving location of paint.exe with c#?

I am making a screenshot program and right now I have a feature that lets the user edit the screenshot in MS Paint. The only problem is, I want the file browser (for saving a paint file) to automatically browse to this…
DavidKenyon96
  • 55
  • 2
  • 9
1
vote
0 answers

C# MessageBox being skipped (not displayed) and DialogResult being automatically set

I have a MessageBox attached to the closing event of my form checking that the user wants to close the form. When the event is triggered, the MessageBox should display, asking the user to select 'Yes' or 'No'. Instead, the MessageBox line is run…
Pete
  • 41
  • 5
1
vote
0 answers

C# WPF Keep dialog (child) window open if input is wrong

I am looking for a solution to not close my dialog window when there is a duplicate ID. I guess it has to do with DialogResult, however, I cannot make neither true or false work. I am opening the "New Store"-window from a button click in my main…
Niclas
  • 1,069
  • 4
  • 18
  • 33
1
vote
2 answers

Dialog Result Set the Return Value

I have created a button on a form for which I set a return value programatically, seen below. First, is the event handler psudocode, followed by where the dialog result is returned to. There is a default property where one can set a button's return…
WholeMilk32
  • 13
  • 1
  • 3