Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
Noob question
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-06-2012, 10:50 PM
Active Member
 
Join Date: Jul 2011
Posts: 237
Default Noob question

hey, i started with a mini project on .NET today, im really a starting beginner. ;p
code;
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If MsgBox("Are you sure you wanna quit?", MsgBoxStyle.OkCancel, MessageBoxIcon.Question = Windows.Forms.DialogResult.Yes) Then End
If MsgBox("Are you sure you wanna quit?", MsgBoxStyle.OkCancel, MessageBoxIcon.Question = Windows.Forms.DialogResult.Cancel) Then

End If
End Sub

End Class

_______________________________
TLDR: Basicly its a "Quit" button and i need to make that if u press cancel the application still stays open, dont flame about my skills or w/e.
Ty!
Reply With Quote
  #2  
Old 01-07-2012, 04:23 AM
Member
 
Join Date: Nov 2011
Posts: 78
Default Re: Noob question

so you want a yes/no messagebox?
If MessageBox.Show("name/stuff", "something", MessageBoxButtons.okcancel, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
MessageBox.Show("you want to quit") 'this = ok
Else
MessageBox.Show("you don't want to quit") 'this = cancel
End If

basically all you did wrong was forget that you needed ELSE

Last edited by matt_sells : 01-07-2012 at 04:27 AM.
Reply With Quote
  #3  
Old 01-07-2012, 10:21 AM
Active Member
 
Join Date: Jul 2011
Posts: 237
Default Re: Noob question

thanks man! , but i need to make when u press "OK" that you quit, now it says "You dont want to quit", but i made
If MessageBox.Show("Are you sure you wanna Quit?", "Quit", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then End
MessageBox.Show("you want to quit")
Else
MsgBox("you don't want to quit", MessageBoxIcon.Exclamation) 'this = cancel
End If
and it gave me 2 errors..

Last edited by Jeroentjo : 01-07-2012 at 10:29 AM.
Reply With Quote
  #4  
Old 01-07-2012, 12:18 PM
Darthatron's Avatar
Massive Troll
Ex-Moderator Visual Basic Programmers
 
Join Date: May 2006
Location: The internet.
Posts: 1,604
Send a message via MSN to Darthatron
Default Re: Noob question

Code:
        If MsgBox("Are you sure you want to quit?", MsgBoxStyle.OkCancel) = DialogResult.OK Then
            End
        End If
You don't need to put the second MsgBox since it doesn't do anything. That will only make it show twice.

If you want to have different things happen, do something like this:
Code:
        Dim result As DialogResult
        result = MsgBox("Are you sure you want to quit?", MsgBoxStyle.OkCancel)
        If result = DialogResult.OK Then
            End
        ElseIf result = DialogResult.Cancel Then
            'Do other stuff here.
        End If
__________________
I do not trade.
Always ask for a PM.
Reply With Quote
  #5  
Old 01-08-2012, 03:13 AM
Covey's Avatar
Creator of EliteSwitch
Ex-Moderator Visual Basic Programmers
 
Join Date: Sep 2005
Location: Fuckin' BAM!
Posts: 4,464
Default Re: Noob question

+1 for Darth
/spam
__________________
EliteSwitch v4 Source Code - http://sythe.org/showthread.php?t=1214654
Reply With Quote
  #7  
Old 01-09-2012, 11:52 PM
Blupig's Avatar
i am a guy ok?? -.-
Ex-Moderator Zombie Visual Basic Programmers
 
Join Date: Nov 2006
Location: Canada
Posts: 5,232
Send a message via MSN to Blupig Send a message via Skype™ to Blupig
MushyMuncher
Default Re: Noob question

Please, for future reference, use the code tags.
__________________
Reply With Quote
  #8  
Old 01-21-2012, 01:19 AM
jasonfish4's Avatar
Member
 
Join Date: Jan 2012
Posts: 40
Default Re: Noob question

Do a me.close()
and then do a form2.show()
quickly.
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 04:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1