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

Maximum call stack size exceeded error at dialogRef.beforeClosed after update to angular 15?

I just updated my angular 14 project to 15 In angular 14 I used the following code to fill dialog result this.dialogRef.beforeClosed().subscribe(() => this.dialogRef.close(this.selectedRows)); It was OK and ran without any error, but after update…
Mohammad Dayyan
  • 21,578
  • 41
  • 164
  • 232
0
votes
0 answers

Type [System.Windows.Forms.DialogResult] is not found despite the Add-Type cmdlet

Despite the Add-Type cmdlet, the PowerShell session does not recognize these types '[System.Windows.Forms.DialogResult]::OK' and '[System.Windows.Forms.DialogResult]::Cancel' inside a class. Do you understand why? It works very well with a simple…
Samuel
  • 1
  • 1
0
votes
1 answer

Pause timer-based program at MessageBox.Show()

I have a MessageBox.Show event that I want to also prevents timer-based methods from running while the MessageBox remains open. Here is my code (Changes the value in a file location on a network every x minutes): public void offlineSetTurn() { …
Omniabsence
  • 171
  • 1
  • 3
  • 13
0
votes
2 answers

how can I return value from show dialog form?

The main form: fDocForm fDocForm = new fDocForm() fDocForm.ShowDialog(); if(fDocForm.DialogResult!=null) //use of id returned from dialog form else MessageBox.Show("null"); in the dialog form: private void button1_Click(object sender,…
MHD
  • 25
  • 9
0
votes
0 answers

Implementing ?: operators with DialogResult Boxes C#

I have this simple piece of code that focuses a text field if the user hits yes on a DialogResult, or exits the application if s/he hits no. DialogResult dialogResult = MessageBox.Show("Client Not Verified\n" + " " + txtUserName.Text + " " +…
user8271424
0
votes
1 answer

The Enter Key does not close a Form if the Focus is on a Button that is not the AcceptButton

I have a modal Form with three Buttons, A B and C. In addition, I have two Buttons: OK and Cancel. The OK Button's DialogResult property is set to DialogResult.OK and the Cancel Button DialogResult.Cancel. The Form's AcceptButton and CancelButton…
user11354125
0
votes
0 answers

MVVM closing dialog form from ViewModel

I want to show a window to create an object based on a form my users fill. What I do now is from my main view model, I instanciate my form window, set its datacontext to a new instance of the corresponding viewmodel class and get ShowDialog() …
Phoque
  • 217
  • 3
  • 14
0
votes
1 answer

How can I move back and forth between two forms without loosing entered data

i have two forms which i want to move back and forth with without loosing the data that i have entered on both form, when i go back to form1 from form2 the data remains in form1, but when i go to form2 in which i have entered data before, the data…
AIDEN IV
  • 79
  • 1
  • 9
0
votes
1 answer

Form opened with ShowDialog closes after exception

I have a FormA from which I open FormB like so: FormB B = new FormB(); FormB.ShowDialog(); In FormB, I have some code in a try catch block and when it throws the exception, FormB is closed. private void func() { try { // some code …
Flo Rida
  • 55
  • 6
0
votes
0 answers

Create (default) Buttons using the local translated Text in C#

i would like to create buttons by c#Script as DialogResult (e.G. DialogResult.Yes) And the text of the button should be the local correct for the language of the user. new Button() { Parent = d, Text = "Oui", DialogResult = DialogResult.Yes }; The…
René W.
  • 150
  • 1
  • 9
0
votes
1 answer

Close current form if dialog results for dialogbox is cancel

I have a Form (frmcustlist). At one time on this list i scan the list using a dataset and check if it now 0 (no customers left). At this stage i have an input box pop up (dialog) to ask a new customer name. If they press OK everything is fine. I…
Glenn Angel
  • 381
  • 1
  • 3
  • 14
0
votes
0 answers

Programmatically set the DialogResult for SaveFileDialog

I have been searching for DAYS for material explaining how to do this... I have a code in WPF (C#) that loops through a collection of FrameworkElements. The objective is to save each of the FrameworkElements as separate images (gif files). The…
Ash
  • 11
  • 1
  • 4
0
votes
2 answers

How to get dialog result from WebBrowser.ShowPageSetupDialog

I'm using a WebBrowser control in my Visual C# (.net 2.0) application. Now I'd like to add a print button which shows the page setup dialog and then directly prints when the user presses the OK button or cancels the printing when the user presses…
Marc
  • 9,012
  • 13
  • 57
  • 72
0
votes
4 answers

Return to the first dialog

I have a WinForm that is used as a Dialog with just OK and Cancel buttons. So: Dim sr As New SlideRangeDialog Dim dr As Windows.Forms.DialogResult dr = sr.ShowDialog I have an If/Then to see if the user pressed OK. If they pressed OK and there is a…
Todd Main
  • 28,951
  • 11
  • 82
  • 146
0
votes
1 answer

C# DialogResult with error check

I'm having a strange problem ... I have two forms (Form1 & Form2). Form1 calls with an old name (string) and the user enters a new name (textbox1) in Form2 which is returned to Form1. Everything works fine if they enter a value or cancel ...…
ArtR45
  • 39
  • 5