Hi Friends, in this article i will explain about VB.NET or C# forms Conformation Box.
I already explained the articles on windows forms.If you want click onWindows Forms.
Code in C#:
Then run the code or press F5. The output will like below.
When we run the form first conformation box is appear and if u press Yes then Done messagebox will come or if you press No then Not done messagebox will come. Windows form appear when you press Ok.
"If you like my blog or articles, you can appreciate by leaving your comments or Liking my Facebook page Aspdotnet-kishore, following on Google+ Aspdotnet-Kishore, Twitter on AspdotnetKishore, Linked in Aspdotnet-Kishore, stumbling my posts on stumble upon and subscribing on RSSfeed Aspdotnet-Kishore for free updates directly to your Email inbox . Watch my blog for more articles."
I already explained the articles on windows forms.If you want click onWindows Forms.
Basically we know about how to display conformation box in
javascript.The conformation is like below.
Let we know about how to create Conformation Box in VB.NET
windows Forms.
Copy and paste the below code in your project.
Dim Box As MsgBoxResult = MsgBox("Are
You Sure You Wish To Delete This ?", MsgBoxStyle.YesNo)
If
Box = MsgBoxResult.Yes Then
MsgBox("Done")
Else
MsgBox("Not
Done")
End If
|
First of all goto
File ---New –Project --- Enter the name of the project ---OK
Goto to code view or double click on the windows form.In the
Page_Load write the following code.
Code in VB.NET:
Protected Sub
Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim
Box As MsgBoxResult = MsgBox("Are You Sure You Wish To Delete This ?",
MsgBoxStyle.YesNo)
If
Box = MsgBoxResult.Yes Then
MsgBox("Done")
Else
MsgBox("Not
Done")
End If
End Sub
|
Code in C#:
MsgBoxResult
Box = Interaction.MsgBox("Are You Sure You
Wish To Delete This ?", MsgBoxStyle.YesNo);
if (Box == MsgBoxResult.Yes) {
Interaction.MsgBox("Done");
} else {
Interaction.MsgBox("Not Done");
}
|
Then run the code or press F5. The output will like below.
When we run the form first conformation box is appear and if u press Yes then Done messagebox will come or if you press No then Not done messagebox will come. Windows form appear when you press Ok.
"If you like my blog or articles, you can appreciate by leaving your comments or Liking my Facebook page Aspdotnet-kishore, following on Google+ Aspdotnet-Kishore, Twitter on AspdotnetKishore, Linked in Aspdotnet-Kishore, stumbling my posts on stumble upon and subscribing on RSSfeed Aspdotnet-Kishore for free updates directly to your Email inbox . Watch my blog for more articles."
No comments:
Post a Comment