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!
@WantACoconutSir10 жыл бұрын
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-mb3hy9 жыл бұрын
why do window have to complicate things like this?
@imfuctifino9 жыл бұрын
+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-c4u7 жыл бұрын
I know this is an old comment, but I found this really useful so thanks mate :).
@GameinTheSkin7 жыл бұрын
Hey man thanks a lot!
@SzczurkiBurki4 жыл бұрын
Oh it works o-o
@Aleebaan11 жыл бұрын
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_5 жыл бұрын
Mr. Albin Hermansson, thank you very much for the kindness you have recently bestowed upon me.
@warlordsquerk53388 жыл бұрын
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.25995 жыл бұрын
Yes, I got that same problem but what you need to do is take off the windows.forms and it should work
@seeranimate43633 жыл бұрын
@@loganscomputerco.2599 Does it work for .vbs?
@yoferenuntar64819 жыл бұрын
why we directly put the if statement rather than, put the messagebox.show first and then make if statements??]
@narutopcwiz13 жыл бұрын
@Zeiterius i recommend to watch the console tutorial first, well it's easy for you to understand that if you know already some language.
@TheHackZone513 жыл бұрын
nice tutorial man...bucky you are AWESOME for doing this .. i mean getting new tutorials
@KiKatXdRbMC6 жыл бұрын
how to create two textbox and if press okay it will show the two separate messagebox rom the two textbox
@sudacaenny12 жыл бұрын
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
@08calf12 жыл бұрын
to add "retrying" we can use elseif copy ElseIf MessageBox.Show("hellow world", "alfred", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Retry Then
@afro23657 жыл бұрын
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
@dietcokedude7 жыл бұрын
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.
@PinGsamY11 жыл бұрын
how is that gonna work , how do you know MessageBox.Show("Click Something", "title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) is an integer type?
@XenoContact11 жыл бұрын
I assume Windows.Forms.DialogResult.Retry, for example, is an integer then?
@holkocz1211 жыл бұрын
Hello Im Poland. I create my first program (Calculator) and I dont know why continue next programms in Virtual Basic . Thanks
@misatotachibana91739 жыл бұрын
HołKocz12 Poland can into windows forms.
@Komyczeq4 жыл бұрын
huj wyjebane
@nataliecook82305 жыл бұрын
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"); } }
@markoperica213 жыл бұрын
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?
@MellowCulture8 жыл бұрын
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
@1368matrix10 жыл бұрын
Its opening 500 times the message box. Any help?
@MouseMan70710 жыл бұрын
Paste the your code if you need help, no one can do anything if they can't see it.
@1368matrix10 жыл бұрын
Already fixed it. I just used the timer.stop() code and it worked, nvm anymore :D
@BrJose10 жыл бұрын
Great tutorials. I'm learning a lot and having fun. Tx!
@zc0rp1013 жыл бұрын
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
@Badadaha12 жыл бұрын
@2pimpinout thanx i was trying to figure out what variable type to use. :P
@ImTheDinoTV8 жыл бұрын
Not working
@LiamRush174310 жыл бұрын
This has helped me so much!! Thx
@TheHackZone513 жыл бұрын
@chili24137 i no man but he is the one who searched for the tutorials !
@zekefernandez603510 жыл бұрын
Thanks for the Tutorial! :) The Select Case is easier than the if then :/
@Jemmeh12 жыл бұрын
That is a good way of doing it. :D
@2pimpinout12 жыл бұрын
It is better if you make it like this: Dim Result As DialogResult = MessageBox.Show("Click Something.", "title", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) If Result = Windows.Forms.DialogResult.Abort Then MsgBox("Aborted!) ElseIf Result = Windows.Forms.DialogResult.Cancel Then MsgBox("Canceled") End If
@chili2413713 жыл бұрын
@TheHackZone5 lol dude, this isn't bucky, roflllllll
@gjh3313 жыл бұрын
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.
@djuroue113 жыл бұрын
@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.
@ocurso61988 жыл бұрын
thank you very much
@partners50747 жыл бұрын
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
@BiggestTrollAlive4211 жыл бұрын
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 :)