Dot Net Perls
Top 27 Windows Example Pages...

["'swr.k((CST~~}T~~Y788XCPXS}T~~}T~~","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.","Example."," This is a Windows Forms program that uses a Form1_Load event handler. We show a MessageBox with the OK and Cancel buttons (seen in the screenshot). We use the MessageBox.Show method for this.","Then,"," we use a switch selection statement on the DialogResult enum local variable. We change the Text property based on what button was clicked in the MessageBox. If the Enter key was pressed, the OK button is used. ","Note: ","The output of this program depends on the button pressed by the user. Try it a few times.","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto","C# program that uses switch on DialogResult","\n\nusing System;\nusing System.Windows.Forms;\n\nnamespace WindowsFormsApplication1\n{\n public partial class Form1 : Form\n {\n public Form1()\n {\n InitializeComponent();\n }\n\n private void Form1_Load(object sender, EventArgs e)\n {\n ","DialogResult"," result = MessageBox.Show(","\"How are you?\"",", ","\"Hi\"",",\n MessageBoxButtons.OKCancel);\n switch (result)\n {\n case DialogResult.OK:\n {\n this.Text = ","\"[OK]\"",";\n break;\n }\n case DialogResult.Cancel:\n {\n this.Text = ","\"[Cancel]\"",";\n break;\n }\n }\n }\n }\n}","Values."," The DialogResult enum contains many different values. Because this enum is not decorated with the [Flags] attribute, you cannot combine multiple enum values. Here are the possible values for DialogResult. ","Also: ","I would like to know how OK and Cancel could be clicked at the same time.","Enum values:","\n\nDialogResult.None\nDialogResult.OK\nDialogResult.Cancel\nDialogResult.Abort\nDialogResult.Retry\nDialogResult.Ignore\nDialogResult.Yes\nDialogResult.No","Summary."," We examined the DialogResult enumerated constant in the Windows Forms graphical user interface toolkit. With this enum we receive an encoded form of the action taken by the user, which can then influence flow control. ","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","3679700504","data-ad-format","link","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto","url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAAC7CAMAAAC0PRAsAAABgFBMVEX/////mf8+JT4QEBCkgqSPj4//tf//zP//5f98S3wZDxm9dL0vHC9ySXL/8v//1//g4ODvj+//+f//pf+oqKjDw8PPfM8jIyN8d3ybYJvfht9rQWtaRVqOVo6tfa2dhp2taq1UUVS3l7frq+vOq85sU2zvlO/ouOgzMzPkzOR0U3R+YX4AAAC2dS3/25BDQEMOKG3U0Mg6AABmtv/Us3FVlMh3LgC2//+2s3E6kNtmAAAwLnHbkDrU0I///7aQ2/93s8iAgIC20MiX0MgAVI8wAC3//9tff7MwdawAZrYAAFG225CQOmZmAGZmZmYAADrUlFE6AGbb//9mADo6OpBEYpy5e3A6Zmb/tmZmOpDU0KwAAGbb/7aXVFFbOFvb/9szUI2kyO4qR4ZMa6MaNXgAOpBoiLs4VZJScah4mcgkQIFwkMFbeq8/XZibvucLd9D/wKSLrdgvS4qXuuNigrWFp9SStN53dVHbkGaNsNufw+owLi1EnugRLHA7WJR/oc/GvOufAAANj0lEQVR4Xuzb1ZLbQBCG0XmgFoKZ2cuMYWZmfPX0qG2lfJEba+LyyP9XKXvXq1JJJ+qx1pWopQqKlKeWK1DFqbs8QlCY8iD40k/pwd+ezbsnvdPd4R6n/eJe6k6l+1lP0l5kjcfjD7pH855nPU37nfVR91b3VfdJ9173SvdNd/cfbSYCENRi3mYiLC4HRhCA8Fq98f1Inf1QsVUIRIE8mkSwbhyIxMAkAj9bNg7EGRsHnX0I2UTgSvgvCFgT8O5g4ZqAmyUgdBfaTARvMTMI+FUaCBw+XlMFaQ0RgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgHBypJTLD0vVIKpuNILU2i0XB8EN6bqsnw/Lo52y/CXvt90Th18N+SsGGJUi1Tpuz7cUumIghMQ9vFGLVGPKZ9TYi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ElEQVR4AWPACZj/f0DmjkqOSjKtQgcLyJccZiEE9SOmP8mXHEaBMBoIo4EwGggryJccvvVKKAogTnJUclRyVHLklgmjkqOSAALWyrsxEHLDAAAAAElFTkSuQmCC)","url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAACCAgMAAADasxWRAAAADFBMVEXZ7/////+VlZX29vYl5th1AAAASElEQVR4AWPACZj/f0DmjkqOSjKtQgcLyJccZiEE9SOmP8mXHEaBMBoIo4EwGggryJccvvVKKAogTnJUclRyVHLklgmjkqOSAALWyrsxEHLDAAAAAElFTkSuQmCC)"]

["url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMkAAABECAMAAAAcNuExAAAAYFBMVEX///9rp/G+1vilx/X0lcz61er3stnye8Hxa7v4vt7+9fruTbDtLqeyzvfGTbv96/T74O/1pdPV5PqObNPM1/biOa3r8v1gf+F7r/LJdMlPme4ujO31+P6SvPTg6/vPqN7UTCZ0AAADTElEQVR4XuzY2W6DMBAFUD/MjFf27N3+/y/rNogBJ7EodUiIuG8XoYETyzKKGB1NkRRiQZEuEnwtySpZJaukktJ2ACV/o1iyrMhwDXBhklWCIKWEf52aSD5lW4wmH5xDwlIQouw2UcU2x8FBcxg+g7zDnovFHwe4tlFaSVxqRWkdu6ZIlNDs1IN50swncZWHcGiCxFWDCYN5kE4C1KYYdeRYM0ESC6Y/HHGUxOnEEniYBBJL7J0lJSoGAAEXdZYYJJb4hngh0WTZj9pxAIlLeT9JaCXfiCmiTfjqXHlGn8/bXvoGDJ9FwstvJ0r4HNI3fhpKJVGyTXlDAlwnS+hCjjHJez0un+F5ErfS/JL6bVwOy5CskpK3y58l9FQS5D5NYl5BAlwXKRGuSyGEUY+QaCIbfgsDS4KvFUDEAR2NCA5L2x/ogK7NKLD/yF6TpCdLRvxLFNzCEsYKcLdCV2YQ9hv2mwwluyzLPobvnHU5pZfopJL4umTMPKSXGPsqEoEDgIRnk+xqn1ESQY6jTPEwyTYf5HytObXeJg8k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