329 references to DialogResult
Accessibility_Core_App (1)
PrintingControls.cs (1)
77if (printDialog1.ShowDialog() == DialogResult.OK)
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\Helpers\VBInputBox.vb (1)
50MyCancelButton.DialogResult = DialogResult.Cancel
PresentationUI (25)
MS\Internal\Documents\Application\FilePresentation.cs (2)
54DialogResult dialogResult; 77if (dialogResult == DialogResult.OK)
MS\Internal\Documents\CredentialManagerDialog.Designer.cs (2)
86this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 93this._okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
MS\Internal\Documents\RightsManagementManager.cs (12)
255internal DialogResult ShowCredentialManagementUI(bool decrypting) 257DialogResult result = DialogResult.Cancel; 312DialogResult result = DialogResult.Cancel; 318result = DialogResult.OK; 329if (result == DialogResult.OK) 339if (result == System.Windows.Forms.DialogResult.OK) 458DialogResult result = DialogResult.Cancel; 465if (result != DialogResult.OK) 1009if(ShowCredentialManagementUI(decrypting) != DialogResult.OK)
MS\Internal\Documents\RMEnrollmentPage1.Designer.cs (2)
188_nextButton.DialogResult = System.Windows.Forms.DialogResult.OK; 197_cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
MS\Internal\Documents\RMEnrollmentPage2.Designer.cs (2)
75this._nextButton.DialogResult = System.Windows.Forms.DialogResult.OK; 84this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
MS\Internal\Documents\RMPermissions.Designer.cs (1)
155this.closeButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
MS\Internal\Documents\RMPublishingDialog.cs (2)
742DialogResult = DialogResult.OK; 761DialogResult = DialogResult.OK;
MS\Internal\Documents\RMPublishingDialog.Designer.cs (1)
313this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
MS\Internal\Documents\SigningDialog.Designer.cs (1)
199_cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
System.Windows.Forms (96)
src\Common\src\RTLAwareMessageBox.cs (1)
16public static DialogResult Show(
System\Windows\Forms\Application.ThreadContext.cs (4)
618DialogResult result = DialogResult.OK; 631case DialogResult.Abort: 635case DialogResult.Yes:
System\Windows\Forms\Controls\Buttons\Button.cs (3)
23private DialogResult _dialogResult; 137[DefaultValue(DialogResult.None)] 139public virtual DialogResult DialogResult
System\Windows\Forms\Controls\Buttons\IButtonControl.cs (1)
15DialogResult DialogResult { get; set; }
System\Windows\Forms\Controls\Labels\LinkLabel.cs (2)
27private DialogResult _dialogResult; 735DialogResult IButtonControl.DialogResult
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (2)
160DialogResult = DialogResult.OK, 172DialogResult = DialogResult.Cancel,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (6)
4846public DialogResult ShowDialog(Form dialog) 4873DialogResult result; 4943revert = uiService.ShowDialog(ErrorDialog) == DialogResult.Cancel; 4947revert = ShowDialog(ErrorDialog) == DialogResult.Cancel; 5018revert = uiService.ShowDialog(ErrorDialog) == DialogResult.Cancel; 5022revert = ShowDialog(ErrorDialog) == DialogResult.Cancel;
System\Windows\Forms\Design\ComponentEditorForm.cs (6)
142DialogResult = DialogResult.OK; 146DialogResult = DialogResult.Cancel; 434public virtual DialogResult ShowForm() 442public virtual DialogResult ShowForm(int page) 450public virtual DialogResult ShowForm(IWin32Window? owner) 458public virtual DialogResult ShowForm(IWin32Window? owner, int page)
System\Windows\Forms\Design\IUIService.cs (2)
44DialogResult ShowDialog(Form form); 75DialogResult ShowMessage(string message, string caption, MessageBoxButtons buttons);
System\Windows\Forms\Design\IWindowsFormsEditorService.cs (1)
60DialogResult ShowDialog(Form dialog);
System\Windows\Forms\Design\WindowsFormsComponentEditor.cs (1)
42return form.ShowForm(owner, GetInitialComponentEditorPageIndex()) == DialogResult.OK;
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (6)
162public DialogResult ShowDialog() => ShowDialog(owner: null); 167public DialogResult ShowDialog(IWin32Window? owner) 179DialogResult result = DialogResult.Cancel; 220result = RunDialog(ownerHwnd.Handle) ? DialogResult.OK : DialogResult.Cancel;
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (1)
675== DialogResult.Yes;
System\Windows\Forms\Dialogs\MessageBox.cs (27)
129public static DialogResult Show( 144public static DialogResult Show( 160public static DialogResult Show( 177public static DialogResult Show( 194public static DialogResult Show( 212public static DialogResult Show( 229public static DialogResult Show( 247public static DialogResult Show( 266public static DialogResult Show( 286public static DialogResult Show( 300public static DialogResult Show( 313public static DialogResult Show( 325public static DialogResult Show(string? text, string? caption, MessageBoxButtons buttons) 333public static DialogResult Show(string? text, string? caption) 341public static DialogResult Show(string? text) 349public static DialogResult Show( 364public static DialogResult Show( 378public static DialogResult Show( 391public static DialogResult Show( 403public static DialogResult Show(IWin32Window? owner, string? text, string? caption) 411public static DialogResult Show(IWin32Window? owner, string? text) 416private static DialogResult ShowCore( 426DialogResult result = DialogResult.None; 440private static DialogResult ShowCore( 452return DialogResult.None; 483return (DialogResult)PInvoke.MessageBox(handle.Handle, text, caption, style);
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (3)
264_continueButton.DialogResult = DialogResult.Cancel; 268_quitButton.DialogResult = DialogResult.Abort; 272_helpButton.DialogResult = DialogResult.Yes;
System\Windows\Forms\Form.cs (26)
153private DialogResult _dialogResult; 171private TaskCompletionSource<DialogResult>? _modalFormCompletion; 719if (value is not null && value.DialogResult == DialogResult.None) 721value.DialogResult = DialogResult.Cancel; 941public DialogResult DialogResult 2055if (value == Visible && _dialogResult == DialogResult.OK) 2085if (_dialogResult != DialogResult.None) 3122if (_dialogResult == DialogResult.None && Visible) 3139_dialogResult = DialogResult.None; 3149if (!closingOnly && _dialogResult != DialogResult.None) 3164_dialogResult = DialogResult.None; 3175return _dialogResult != DialogResult.None || !Visible; 5559public DialogResult ShowDialog() => ShowDialog(owner: null); 5564public DialogResult ShowDialog(IWin32Window? owner) 5634_dialogResult = DialogResult.None; 5671if (_dialogResult == DialogResult.None) 5759public Task<DialogResult> ShowDialogAsync() => ShowDialogAsyncInternal(owner: null); 5800public Task<DialogResult> ShowDialogAsync(IWin32Window owner) => ShowDialogAsyncInternal(owner); 5802private Task<DialogResult> ShowDialogAsyncInternal(IWin32Window? owner) 5811_modalFormCompletion = new TaskCompletionSource<DialogResult>(TaskCreationOptions.RunContinuationsAsynchronously); 5828void ShowDialogProc(ref TaskCompletionSource<DialogResult> modalFormCompletion, IWin32Window? owner = default) 5832DialogResult result = ShowDialog(owner); 6578if (_dialogResult == DialogResult.None) 6580_dialogResult = DialogResult.Cancel; 6885if (Modal && _dialogResult == DialogResult.None) 6889DialogResult = DialogResult.Cancel;
System\Windows\Forms\MDI\MDIWindowDialog.cs (2)
110_okButton.DialogResult = DialogResult.OK; 117_cancelButton.DialogResult = DialogResult.Cancel;
System\Windows\Forms\MDI\MdiWindowListStrip.cs (2)
167DialogResult result = dialog.ShowDialog(); 168if (result == DialogResult.OK)
System.Windows.Forms.Design (65)
src\Common\src\RTLAwareMessageBox.cs (1)
16public static DialogResult Show(
System\ComponentModel\Design\BinaryEditor.BinaryUI.cs (3)
113DialogResult result = sfd.ShowDialog(); 114if (result == DialogResult.OK) 183_buttonOK.DialogResult = DialogResult.OK;
System\ComponentModel\Design\BinaryEditor.cs (1)
113if (editorService.ShowDialog(_binaryUI) == DialogResult.OK)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (8)
285DialogResult = DialogResult.None; 463_okButton.DialogResult = DialogResult.OK; 468_cancelButton.DialogResult = DialogResult.Cancel; 671DialogResult = DialogResult.Cancel; 706DialogResult = DialogResult.None; 954protected internal override DialogResult ShowEditorDialog(IWindowsFormsEditorService edSvc) 957DialogResult result = DialogResult.OK;
System\ComponentModel\Design\CollectionEditor.CollectionForm.cs (1)
182protected internal virtual DialogResult ShowEditorDialog(IWindowsFormsEditorService edSvc)
System\ComponentModel\Design\CollectionEditor.cs (1)
257if (localCollectionForm.ShowEditorDialog(editorService) == DialogResult.OK)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
417DialogResult IWindowsFormsEditorService.ShowDialog(Form dialog)
System\Drawing\Design\ColorEditor.ColorPalette.cs (2)
245DialogResult result = dialog.ShowDialog(); 246if (result != DialogResult.Cancel)
System\Drawing\Design\FontEditor.cs (1)
41if (_fontDialog.ShowDialog() == DialogResult.OK)
System\Drawing\Design\IconEditor.cs (1)
76if (_fileDialog.ShowDialog() == DialogResult.OK)
System\Drawing\Design\ImageEditor.cs (1)
104if (_fileDialog.ShowDialog() == DialogResult.OK)
System\Windows\Forms\Design\CollectionEditVerbManager.cs (1)
169DialogResult IWindowsFormsEditorService.ShowDialog(Form dialog)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (1)
568DialogResult = DialogResult.OK;
System\Windows\Forms\Design\DataGridViewCellStyleBuilder.cs (2)
203_okButton.DialogResult = DialogResult.OK; 208_cancelButton.DialogResult = DialogResult.Cancel;
System\Windows\Forms\Design\DataGridViewCellStyleEditor.cs (1)
39if (_builderDialog.ShowDialog() == DialogResult.OK)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (3)
282DialogResult = DialogResult.Cancel; 601_cancelButton.DialogResult = DialogResult.Cancel; 609_okButton.DialogResult = DialogResult.OK;
System\Windows\Forms\Design\DataGridViewDesigner.cs (7)
749DialogResult result = DialogResult.Cancel; 757if (result == DialogResult.OK) 772DialogResult result = DialogResult.Cancel; 785if (result == DialogResult.OK) 796private DialogResult ShowDialog(Form dialog)
System\Windows\Forms\Design\EditorServiceContext.cs (1)
123DialogResult IWindowsFormsEditorService.ShowDialog(Form dialog)
System\Windows\Forms\Design\FileNameEditor.cs (1)
35if (_openFileDialog.ShowDialog() == DialogResult.OK)
System\Windows\Forms\Design\FolderNameEditor.cs (1)
25if (_folderBrowser.ShowDialog() == DialogResult.OK)
System\Windows\Forms\Design\FolderNameEditor.FolderBrowser.cs (4)
46public DialogResult ShowDialog() => ShowDialog(null); 51public unsafe DialogResult ShowDialog(IWin32Window? owner) 70return DialogResult.OK; 73return DialogResult.Cancel;
System\Windows\Forms\Design\FormatStringDialog.cs (4)
187_cancelButton.DialogResult = DialogResult.Cancel; 197_okButton.DialogResult = DialogResult.OK; 245DialogResult = DialogResult.OK; 251DialogResult = DialogResult.Cancel;
System\Windows\Forms\Design\ImageListImageEditor.cs (1)
70if (_fileDialog.ShowDialog() == DialogResult.OK)
System\Windows\Forms\Design\LinkAreaEditor.cs (1)
48if (editorService.ShowDialog(_linkAreaUI) == DialogResult.OK)
System\Windows\Forms\Design\LinkAreaEditor.LinkAreaUI.cs (2)
75_okButton.DialogResult = DialogResult.OK; 81_cancelButton.DialogResult = DialogResult.Cancel;
System\Windows\Forms\Design\MaskDesignerDialog.cs (2)
188_btnOK.DialogResult = DialogResult.OK; 197_btnCancel.DialogResult = DialogResult.Cancel;
System\Windows\Forms\Design\MaskPropertyEditor.cs (2)
39DialogResult result = uiService is not null ? uiService.ShowDialog(dialog) : dialog.ShowDialog(); 40if (result == DialogResult.OK)
System\Windows\Forms\Design\StringCollectionEditor.StringCollectionForm.cs (3)
101_okButton.DialogResult = DialogResult.OK; 107_cancelButton.DialogResult = DialogResult.Cancel; 167DialogResult = DialogResult.Cancel;
System\Windows\Forms\Design\StyleEditorForm.cs (5)
254_cancelButton.DialogResult = DialogResult.Cancel; 508protected internal override DialogResult ShowEditorDialog(IWindowsFormsEditorService edSvc) 1100DialogResult = DialogResult.OK; 1104DialogResult = DialogResult.Cancel; 1116DialogResult = DialogResult.Cancel;
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (2)
242_okButton.DialogResult = DialogResult.OK; 247_btnCancel.DialogResult = DialogResult.Cancel;
System.Windows.Forms.Design.Tests (31)
BinaryEditorTests.cs (1)
20.Returns(DialogResult.OK);
System\ComponentModel\Design\CollectionEditorTests.cs (14)
154.Returns(DialogResult.OK); 197.Returns(DialogResult.OK); 245.Returns(DialogResult.OK); 295.Returns(DialogResult.OK); 410.Returns(DialogResult.OK); 447.Returns(DialogResult.OK); 524.Returns(DialogResult.OK); 557.Returns(DialogResult.OK); 597.Returns(DialogResult.OK); 644.Returns(DialogResult.Cancel); 691.Returns(DialogResult.OK); 842.Returns(DialogResult.OK); 946.Returns(DialogResult.OK); 989.Returns(DialogResult.OK);
System\ComponentModel\Design\CollectionFormTests.cs (15)
111.Returns(DialogResult.OK); 167.Returns(DialogResult.OK); 226.Returns(DialogResult.OK); 285.Returns(DialogResult.OK); 344.Returns(DialogResult.OK); 392.Returns(DialogResult.OK); 504.Returns(DialogResult.OK); 548.Returns(DialogResult.OK); 597.Returns(DialogResult.OK); 648.Returns(DialogResult.OK); 719.Returns(DialogResult.OK); 763.Returns(DialogResult.OK); 812.Returns(DialogResult.OK); 813Assert.Equal(DialogResult.OK, form.ShowEditorDialog(mockEditorService.Object)); 877public new DialogResult ShowEditorDialog(IWindowsFormsEditorService edSvc) => base.ShowEditorDialog(edSvc);
System\Windows\Forms\Design\MaskedTextBoxTextEditorTests.cs (1)
25.Returns(DialogResult.OK);
System.Windows.Forms.Tests (78)
System\Windows\Forms\ButtonBaseTests.cs (1)
9256public DialogResult DialogResult { get; set; }
System\Windows\Forms\ButtonTests.cs (19)
60Assert.Equal(DialogResult.None, control.DialogResult); 613[EnumData<DialogResult>] 614public void Button_DialogResult_Set_GetReturnsExpected(DialogResult value) 630[EnumData<DialogResult>] 631public void Button_DialogResult_SetWithHandle_GetReturnsExpected(DialogResult value) 659[InvalidEnumData<DialogResult>] 660public void Button_DialogResult_SetInvalidValue_ThrowsInvalidEnumArgumentException(DialogResult value) 1942DialogResult = DialogResult.Yes 1956Assert.Equal(DialogResult.Yes, form.DialogResult); 1966Assert.Equal(DialogResult.Yes, form.DialogResult); 2024DialogResult = DialogResult.Yes 2045Assert.Equal(DialogResult.Yes, form.DialogResult); 2057Assert.Equal(DialogResult.Yes, form.DialogResult); 3126DialogResult = DialogResult.Yes 3140Assert.Equal(DialogResult.None, form.DialogResult); 3149Assert.Equal(DialogResult.None, form.DialogResult); 3204DialogResult = DialogResult.Yes 3225Assert.Equal(DialogResult.None, form.DialogResult); 3237Assert.Equal(DialogResult.None, form.DialogResult);
System\Windows\Forms\CommonDialogTests.cs (30)
91[InlineData(true, DialogResult.OK)] 92[InlineData(false, DialogResult.Cancel)] 93public void ShowDialog_NoOwner_ReturnsExpected(bool runDialogResult, DialogResult expectedDialogResult) 104[InlineData(true, DialogResult.OK)] 105[InlineData(false, DialogResult.Cancel)] 106public void ShowDialog_NonControlOwner_ReturnsExpected(bool runDialogResult, DialogResult expectedDialogResult) 120[InlineData(true, DialogResult.OK)] 121[InlineData(false, DialogResult.Cancel)] 122public void ShowDialog_NonControlOwnerWithVisualStyles_ReturnsExpected(bool runDialogResultParam, DialogResult expectedDialogResultParam) 128DialogResult expectedDialogResult = (DialogResult)Enum.Parse(typeof(DialogResult), expectedDialogResultString); 145[InlineData(true, DialogResult.OK)] 146[InlineData(false, DialogResult.Cancel)] 147public void ShowDialog_ControlOwner_ReturnsExpected(bool runDialogResult, DialogResult expectedDialogResult) 158[InlineData(true, DialogResult.OK)] 159[InlineData(false, DialogResult.Cancel)] 160public void ShowDialog_ControlOwnerWithVisualStyles_ReturnsExpected(bool runDialogResultParam, DialogResult expectedDialogResultParam) 166DialogResult expectedDialogResult = (DialogResult)Enum.Parse(typeof(DialogResult), expectedDialogResultString); 180[InlineData(true, DialogResult.OK)] 181[InlineData(false, DialogResult.Cancel)] 182public void ShowDialog_ControlOwnerWithHandle_ReturnsExpected(bool runDialogResult, DialogResult expectedDialogResult) 194[InlineData(true, DialogResult.OK)] 195[InlineData(false, DialogResult.Cancel)] 196public void ShowDialog_ControlOwnerWithHandleWithVisualStyles_ReturnsExpected(bool runDialogResultParam, DialogResult expectedDialogResultParam) 202DialogResult expectedDialogResult = (DialogResult)Enum.Parse(typeof(DialogResult), expectedDialogResultString);
System\Windows\Forms\Design\ComponentEditorFormTests.cs (1)
78Assert.Equal(DialogResult.None, control.DialogResult);
System\Windows\Forms\FormTests.cs (27)
77Assert.Equal(DialogResult.None, control.DialogResult); 1829DialogResult expectedDialogResult = DialogResult.OK; 1851foreach (DialogResult dialogResult in Enum.GetValues(typeof(DialogResult))) 1860public void Form_Visible_Set_GetReturnsExpected(DialogResult dialogResult, bool value) 1888foreach (DialogResult dialogResult in Enum.GetValues(typeof(DialogResult))) 1899public void Form_Visible_SetMdiChild_GetReturnsExpected(DialogResult dialogResult, bool parentVisible, bool value, bool expected) 1933public void Form_Visible_SetWithHandle_GetReturnsExpected(DialogResult dialogResult, bool value) 1980[EnumData<DialogResult>] 1981public void Form_Visible_SetTrueMdiChildVisibleWithHandle_GetReturnsExpected(DialogResult dialogResult) 2002Assert.Equal(dialogResult is DialogResult.OK or DialogResult.None, control.Visible); 2003Assert.Equal(dialogResult is DialogResult.OK or DialogResult.None, control.IsHandleCreated); 2022Assert.Equal(dialogResult != DialogResult.OK, control.Visible); 2023Assert.Equal(dialogResult != DialogResult.OK, control.IsHandleCreated); 2032[EnumData<DialogResult>] 2033public void Form_Visible_SetFalseMdiChildVisibleWithHandle_GetReturnsExpected(DialogResult dialogResult) 2064Assert.Equal(dialogResult == DialogResult.None, control.Visible); 2065Assert.Equal(dialogResult == DialogResult.None, control.IsHandleCreated); 2085public void Form_Visible_SetMdiChildNotVisibleWithHandle_GetReturnsExpected(DialogResult dialogResult, bool value) 2118foreach (DialogResult dialogResult in Enum.GetValues(typeof(DialogResult))) 2127public void Form_Visible_SetTrueWithHandler_CallsVisibleChanged(DialogResult dialogResult, bool value, int expectedLoadCallCount) 2288public void Form_Visible_SetTrueWithHandlerWithHandle_CallsVisibleChanged(DialogResult dialogResult, bool value, int expectedLoadCallCount)
System.Windows.Forms.UI.IntegrationTests (25)
ButtonTests.cs (17)
19[InlineData(DialogResult.Abort)] 20[InlineData(DialogResult.Cancel)] 21[InlineData(DialogResult.Ignore)] 22[InlineData(DialogResult.No)] 23[InlineData(DialogResult.OK)] 24[InlineData(DialogResult.Retry)] 25[InlineData(DialogResult.Yes)] 27[InlineData(DialogResult.None)] 28public async Task Button_DialogResult_ClickDefaultButtonToCloseFormAsync(DialogResult dialogResult) 32Assert.Equal(DialogResult.None, button.DialogResult); 39Assert.Equal(DialogResult.None, form.DialogResult); 50Assert.Equal(dialogResult == DialogResult.None, form.Visible); 62button.DialogResult = DialogResult.OK; 70Assert.Equal(DialogResult.OK, form.DialogResult); 80button.DialogResult = DialogResult.OK; 88Assert.Equal(DialogResult.None, form.DialogResult); 107Assert.Equal(DialogResult.Cancel, form.DialogResult);
FolderBrowserDialogTests.cs (1)
27Assert.Equal(DialogResult.Cancel, dialog.ShowDialog(dialogOwnerForm));
FolderNameEditorTests.cs (1)
46if (_folderBrowser.ShowDialog(dialogOwnerForm) == DialogResult.OK)
MessageBoxTests.cs (1)
12Assert.Equal(DialogResult.None, MessageBox.Show("Testing DialogResult"));
OpenFileDialogTests.cs (3)
22Assert.Equal(DialogResult.Cancel, dialog.ShowDialog(dialogOwnerForm)); 31Assert.Equal(DialogResult.Cancel, dialog.ShowDialog(dialogOwnerForm)); 44Assert.Equal(DialogResult.OK, dialog.ShowDialog(dialogOwnerForm));
PrintDialogTests.cs (2)
22Assert.Equal(DialogResult.Cancel, dialog.ShowDialog(dialogOwnerForm)); 31Assert.Equal(DialogResult.OK, dialog.ShowDialog(dialogOwnerForm));
WinFormsControlsTest (7)
ListViewTest.cs (3)
242if (openFileDialog1.ShowDialog() != DialogResult.OK) 271DialogResult result = openFileDialog1.ShowDialog(); 274if (result != DialogResult.OK)
RichTextBoxes.cs (2)
130Button confirmation = new() { Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK }; 137return prompt.ShowDialog() == DialogResult.OK ? textBox.Text : "";
TaskDialogSamples.cs (2)
57DialogResult messageBoxResult = MessageBox.Show( 65if (messageBoxResult == DialogResult.Yes)