Blubb1337 (03-03-2010),Disco // (08-12-2010),hopefordope (03-03-2010),MJLover (03-05-2010),mnpeepno2 (03-03-2010),Retoxified (03-03-2010),Sketchy (09-12-2011),why06 (03-03-2010),XGelite_backup (03-03-2010),Zoom (03-03-2010),___x][GooD. (01-19-2011)

382
[Tutorial] MsgBox Fundementals In Vb.net
On more then a few occasions questions have been raised in regards to MsgBox's , So, I fugure a MessageBox Tutorial is in order.
Code Snippets
Create a Standard MessageBox
Or the one that is least known and least usedCode:MsgBox ("Your Message Here")
Note: Both Work in the same capacity.Code:Interaction.MsgBox("Your Message Here")
VB Abort, Retry , Cancel With Title
MsgBox and VbYesCode:MsgBox("This is a messagebox with Abort, Retry Cancel, and You can set the Title of the messagebox", MsgBoxStyle.AbortRetryIgnore, "Title")
Return a Value from msgboxCode:Dim exitout As String exitout = MsgBox("Would You Like To Exit?", Microsoft.VisualBasic.MsgBoxStyle.Exclamation + Microsoft.VisualBasic.MsgBoxStyle.YesNo + Microsoft.VisualBasic.MsgBoxStyle.MsgBoxHelp, "Title") If exitout = vbYes Then End End If
IconsCode:Dim ReturnV As Integer ReturnV = MsgBox("This is a message box!",MsgBoxStyle.OKCancel + MsgBoxStyle******rmation + MsgBoxStyle.SystemModal, "Message Box") If (ReturnV = MsgBoxResult.OK) Then Label1.Text("OK button Has Been Clicked") 'Or use a messagebox, or a textbox or a listbox etc. etc. etc . End If
You will notice in alot of these examples I am using the code
This allows you to display the Microsoft message box icon/Style you would like to displayCode:Microsoft.VisualBasic.MsgBoxStyle.Exclamation
Here is the list of icons and style of MsgBox to display
Exclamation
Information IconCode:Microsoft.VisualBasic.MsgBoxStyle.Exclamation
Code:Microsoft.VisualBasic.MsgBoxStyle******rmation
Critical Error
QuestionCode:MsgBoxStyle.OkCancel + MsgBoxStyle.Critical
Hope this helps.Code:MsgBoxStyle.OkCancel + MsgBoxStyle.Question
Blubb1337 (03-03-2010),Disco // (08-12-2010),hopefordope (03-03-2010),MJLover (03-05-2010),mnpeepno2 (03-03-2010),Retoxified (03-03-2010),Sketchy (09-12-2011),why06 (03-03-2010),XGelite_backup (03-03-2010),Zoom (03-03-2010),___x][GooD. (01-19-2011)
thanks for posting this tutorial might help some newbs =P
NextGen1 (03-03-2010)

382
I received 3 PM(s) At-least regarding message box's and there has been 1 maybe 2 posts thats 4-5 times... Figured , it needed to be done![]()
Easy to understand! Good job as always
Grattz on 1300posts
-Rest in peace leechers-
Your PM box is 100% full.
NextGen1 (03-03-2010)
Good work!
NextGen1 (03-03-2010)
Requests for tutorials on messageboxes? What the f* do these kids get in school o__O
NextGen1 (03-03-2010)
NextGen1 (03-03-2010)
Nice tutorial NextGen1!
Hmmmm... Don't mean to Hijack your thread, but lately I've been seeing that Critical Error Icon a lot. lol :P
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower