Visual Basic Tutorial - 40 - MessageBox Input

  Рет қаралды 142,690

thenewboston

thenewboston

Күн бұрын

Пікірлер: 57
@mamaduck6845
@mamaduck6845 10 жыл бұрын
I just wanted to comment that I am very impressed with the organized approach you are taking in your tutorials. Very methodical and clear. Unusual for a techy!
@WantACoconutSir
@WantACoconutSir 10 жыл бұрын
For those who only managed to have two printed out (e.g. abort and retry, but can't get the messagebox for ignored to show up) then you need to assign the messagebox to a variable, so it would look something like this: Dim Selection As String Selection = MessageBox.Show("Message", "Title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Information) If Selection = Windows.Forms.DialogResult.Abort Then MessageBox.Show("Aborted") ElseIf Selection = Windows.Forms.DialogResult.Retry Then MessageBox.Show("Retry") ElseIf Selection = Windows.Forms.DialogResult.Ignore Then MessageBox.Show("Ignored") End If End Sub End Class
@lorenzogarcia-mb3hy
@lorenzogarcia-mb3hy 9 жыл бұрын
why do window have to complicate things like this?
@imfuctifino
@imfuctifino 9 жыл бұрын
+For Nachos Can you explain why it doesn't show the 3rd case ? I'm trying to understand but It's Very frustrating trying to apply rules taught that on the face of it appear simple but don't work.
@IG7799-c4u
@IG7799-c4u 7 жыл бұрын
I know this is an old comment, but I found this really useful so thanks mate :).
@GameinTheSkin
@GameinTheSkin 7 жыл бұрын
Hey man thanks a lot!
@SzczurkiBurki
@SzczurkiBurki 4 жыл бұрын
Oh it works o-o
@Aleebaan
@Aleebaan 11 жыл бұрын
Select Case MessageBox.Show("Click!", "Title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) Case Windows.Forms.DialogResult.Abort MessageBox.Show("Aborted") Case Windows.Forms.DialogResult.Ignore MessageBox.Show("Ignored") Case Windows.Forms.DialogResult.Retry MessageBox.Show("Retried") Select Case is way easier to use! Just a tip!
@Janmba_
@Janmba_ 5 жыл бұрын
Mr. Albin Hermansson, thank you very much for the kindness you have recently bestowed upon me.
@warlordsquerk5338
@warlordsquerk5338 8 жыл бұрын
FYI I'm using Visual Studio 2015 Community Edition and "Windows.Forms.DialogResult.Abort" doesn't work. It says "Forms is not a member of windows". Instead what you gotta do is just use "DialogResult.Abort"
@loganscomputerco.2599
@loganscomputerco.2599 5 жыл бұрын
Yes, I got that same problem but what you need to do is take off the windows.forms and it should work
@seeranimate4363
@seeranimate4363 3 жыл бұрын
@@loganscomputerco.2599 Does it work for .vbs?
@yoferenuntar6481
@yoferenuntar6481 9 жыл бұрын
why we directly put the if statement rather than, put the messagebox.show first and then make if statements??]
@narutopcwiz
@narutopcwiz 13 жыл бұрын
@Zeiterius i recommend to watch the console tutorial first, well it's easy for you to understand that if you know already some language.
@TheHackZone5
@TheHackZone5 13 жыл бұрын
nice tutorial man...bucky you are AWESOME for doing this .. i mean getting new tutorials
@KiKatXdRbMC
@KiKatXdRbMC 6 жыл бұрын
how to create two textbox and if press okay it will show the two separate messagebox rom the two textbox
@sudacaenny
@sudacaenny 12 жыл бұрын
Hello sam your tutorials are awesome but I need a little help on this tutorial. I am trying to use the Select case for this tutorial instead of the if statement, but I am having a hard time you showed how to use the case selector for console aplications but I dont know how to do it in this case windows ap
@08calf
@08calf 12 жыл бұрын
to add "retrying" we can use elseif copy ElseIf MessageBox.Show("hellow world", "alfred", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Retry Then
@afro2365
@afro2365 7 жыл бұрын
Sam, any idea why when I create Else IF statements in the code for the additional buttons that I have to click the buttons multiple times in order to get the response. In the code below, the order is Abort/Retry/Ignore. I have to Click Abort once, Retry Twice, and Ignore three times to get the Messagebox.Show output. This is in Visual Studio Pro 2015 so replace Windows.Forms.DialogResult.*result* with DialogResult.*result* Public Class Form1 Private Sub BtnMessage_Click(sender As Object, e As EventArgs) Handles BtnMessage.Click If MessageBox.Show("Click Something", "Title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) = DialogResult.Abort Then MessageBox.Show("aborted") ElseIf MessageBox.Show("Click Something", "Title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) = DialogResult.Retry Then MessageBox.Show("Retrying Now") ElseIf MessageBox.Show("Click Something", "Title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) = DialogResult.Ignore Then MessageBox.Show("Ignored") End If End Sub End Class
@dietcokedude
@dietcokedude 7 жыл бұрын
I had the same problem with Visual Studio Community 2015. -a solution i found that worked was instead of using "else if", i used 3 "if" "end if" statements and it worked Without the clicking two and three times thing.
@PinGsamY
@PinGsamY 11 жыл бұрын
how is that gonna work , how do you know MessageBox.Show("Click Something", "title", MessageBoxButtons.AbortRetryIg­nore, MessageBoxIcon.Question) is an integer type?
@XenoContact
@XenoContact 11 жыл бұрын
I assume Windows.Forms.DialogResult.Ret­ry, for example, is an integer then?
@holkocz12
@holkocz12 11 жыл бұрын
Hello Im Poland. I create my first program (Calculator) and I dont know why continue next programms in Virtual Basic . Thanks
@misatotachibana9173
@misatotachibana9173 9 жыл бұрын
HołKocz12 Poland can into windows forms.
@Komyczeq
@Komyczeq 4 жыл бұрын
huj wyjebane
@nataliecook8230
@nataliecook8230 5 жыл бұрын
FYI for those who are using Visual Studio 2015 Enterprise and "Windows.Forms.DialogResult.Abort" doesn't work, use "DialogResult.Abort" and if the "then" doesn't work also. It means you have to use the C# language. Try this: { DialogResult dialog = MessageBox.Show("click something.", "title", MessageBoxButtons.AbortRetryIgnore, MessageBox.Icon.Question); if (dialog == DialogResult.Abort) { MessageBox.Show("aborted"); } else if (dialog == DialogResult.Retry) { MessageBox.Show("retried"); } else if (dialog == DialogResult.Ignore) { MessageBox.Show("ignored"); } }
@markoperica2
@markoperica2 13 жыл бұрын
If MessageBox.Show("Click something", "Title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Abort Then MessageBox.Show("Aborted") ElseIf Windows.Forms.DialogResult.Retry Then MessageBox.Show("Retrying") ElseIf Windows.Forms.DialogResult.Ignore Then MessageBox.Show("Ignoring!") Im having problems with thos: when i click ignore it sads retrying.. WTF?
@MellowCulture
@MellowCulture 8 жыл бұрын
Dim Selection As String = Nothing Selection = MessageBox.Show("Message", "Title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Information) Select Case Selection Case Windows.Forms.DialogResult.Abort MessageBox.Show("FOR ABORT") Case Windows.Forms.DialogResult.Retry MessageBox.Show("FOR RETRY") Case Else MessageBox.Show("FOR IGNORE") End Select
@1368matrix
@1368matrix 10 жыл бұрын
Its opening 500 times the message box. Any help?
@MouseMan707
@MouseMan707 10 жыл бұрын
Paste the your code if you need help, no one can do anything if they can't see it.
@1368matrix
@1368matrix 10 жыл бұрын
Already fixed it. I just used the timer.stop() code and it worked, nvm anymore :D
@BrJose
@BrJose 10 жыл бұрын
Great tutorials. I'm learning a lot and having fun. Tx!
@zc0rp10
@zc0rp10 13 жыл бұрын
I ended up using the select option, looked like this: Private Sub btnMessage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMessage.Click Select Case MessageBox.Show("Click Something.", "title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) Case Windows.Forms.DialogResult.Abort MessageBox.Show("Aborted") Case Windows.Forms.DialogResult.Retry MessageBox.Show("Retrying") Case Windows.Forms.DialogResult.Ignore MessageBox.Show("Ignored") End Select
@Badadaha
@Badadaha 12 жыл бұрын
@2pimpinout thanx i was trying to figure out what variable type to use. :P
@ImTheDinoTV
@ImTheDinoTV 8 жыл бұрын
Not working
@LiamRush1743
@LiamRush1743 10 жыл бұрын
This has helped me so much!! Thx
@TheHackZone5
@TheHackZone5 13 жыл бұрын
@chili24137 i no man but he is the one who searched for the tutorials !
@zekefernandez6035
@zekefernandez6035 10 жыл бұрын
Thanks for the Tutorial! :) The Select Case is easier than the if then :/
@Jemmeh
@Jemmeh 12 жыл бұрын
That is a good way of doing it. :D
@2pimpinout
@2pimpinout 12 жыл бұрын
It is better if you make it like this: Dim Result As DialogResult = MessageBox.Show("Click Something.", "title", MessageBoxButtons.AbortRetryIg­nore, MessageBoxIcon.Question) If Result = Windows.Forms.DialogResult.Abort Then MsgBox("Aborted!) ElseIf Result = Windows.Forms.DialogResult.Cancel Then MsgBox("Canceled") End If
@chili24137
@chili24137 13 жыл бұрын
@TheHackZone5 lol dude, this isn't bucky, roflllllll
@gjh33
@gjh33 13 жыл бұрын
couldn't you put the MessageBox.Show() inside a variable then test the variable for results. That's how its done in VBS. Also, Does anyone else want to punch their computer when a program underlines a spelling/grammer mistake? I hate that so much. MS Word pisses me off the most.
@djuroue1
@djuroue1 13 жыл бұрын
@gjh33 Congraz man Dim message As string = MessageBox.Show("clic smth", "tittle", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) and then just if ... retry if ignore if aborted an worked :))) before i have your comment i have tried just if if if with whole message thibg and work but just if click one time on first,two time on second and three time on tird ;((( Who will try that way they will know what i am talking about.
@ocurso6198
@ocurso6198 8 жыл бұрын
thank you very much
@partners5074
@partners5074 7 жыл бұрын
Dim x As String = MessageBox.Show("M", "T", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) If x = Windows.Forms.DialogResult.Abort Then MessageBox.Show("A") ElseIf x = Windows.Forms.DialogResult.Retry Then MessageBox.Show("R") Else MessageBox.Show("I") End If
@BiggestTrollAlive42
@BiggestTrollAlive42 11 жыл бұрын
Select Case intResult Case Windows.Forms.DialogResult.Ignore MessageBox.Show("You ignored it") Case Windows.Forms.DialogResult.Retry MessageBox.Show("Try again cowboy!") Case Windows.Forms.DialogResult.Abort MessageBox.Show("You aborted a baby") End Select Select makes it so much easier and cleaner though :)
@dithiraravindu8629
@dithiraravindu8629 2 жыл бұрын
👍👍🙏
@braveheart8552
@braveheart8552 9 жыл бұрын
thank you
@_Wruce_Bayne
@_Wruce_Bayne 11 жыл бұрын
Thank you.!!!
@blueglue6266
@blueglue6266 8 жыл бұрын
So helpfu,l thx bro!!
@ron030363
@ron030363 9 жыл бұрын
Why are you fucking messing with my mind?
Visual Basic Tutorial - 41 - Input Box
4:19
thenewboston
Рет қаралды 191 М.
How to Master the VBA Message Box in 6 Minutes
5:52
Excel Macro Mastery
Рет қаралды 48 М.
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН
Every team from the Bracket Buster! Who ya got? 😏
0:53
FailArmy Shorts
Рет қаралды 13 МЛН
Visual Basic.NET Programming. Beginner Lesson 1. Hello Visual Studio
13:04
Computer Science Lessons
Рет қаралды 485 М.
Visual Basic Tutorial - 43 - Functions
5:27
thenewboston
Рет қаралды 164 М.
Visual Basic (VB.NET) - Full Course for Beginners
3:17:20
freeCodeCamp.org
Рет қаралды 1 МЛН
How does a USB keyboard work?
34:15
Ben Eater
Рет қаралды 3,3 МЛН
Visual Basic Tutorial - 36 - Introduction To Windows Forms
6:15
thenewboston
Рет қаралды 157 М.
MESSAGE BOX : Visual Basic . Net for Beginners
5:45
Teacher Zhai
Рет қаралды 1 М.
Visual Basic .NET Tutorial 7 - How to use a Listbox in VB.NET
6:49
ProgrammingKnowledge
Рет қаралды 273 М.
Visual Basic for Beginners Project #1 : Hello World Program | 2016 Tutorial
5:24
Visual Basic .NET Tutorial 36 - How to use Chart /Graph in VB.NET
8:25
ProgrammingKnowledge
Рет қаралды 265 М.
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН