Does this code look Cool

mattcya

Member
Joined
Jun 18, 2004
Messages
16
Programming Experience
Beginner
Hi Guys,

Does this code look cool, because i am getting frustrated with Visual studio 2002 architect edition telling me it hates it. Just wanted to double check.

Cheers

Mattcya

PrivateSub mnuQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuQuit.Click

If mnuAskBeforeClosing.Checked Then

MessageBox.Show("Do you really wish to exit?","Menus", _

MessageBoxButtons.YesNo) = DialogResult.No
Then

ExitSub

EndIf

Me.Close()

EndSub

 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
VB.NET:
[size=2][color=#0000ff]Private[/color][/size][size=2][color=#0000ff]Sub[/color][/size][size=2][color=#51ff51] mnuquit_Click([/color][/size][size=2][color=#0000ff]ByVal[/color][/size][size=2][color=#51ff51] sender [/color][/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#51ff51] System.Object, [/color][/size][size=2][color=#0000ff]ByVal[/color][/size][size=2][color=#51ff51] e [/color][/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#51ff51] System.EventArgs) [/color][/size][size=2][color=#0000ff]Handles[/color][/size][size=2][color=#51ff51] mnuquit.Click[/color]
 
[/size][size=2][color=#0000ff]If[/color][/size][size=2] mnuAsk.Checked [/size][size=2][color=#0000ff]Then
 
[/color][/size][size=2][color=#0000ff]If[/color][/size][size=2] MessageBox.Show("Do you really wish to exit?", "Menus", MessageBoxButtons.YesNo) = DialogResult.No [/size][size=2][color=#0000ff]Then
 
[/color][/size][size=2][color=#0000ff]Exit[/color][/size][size=2][color=#0000ff]Sub
 
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
 
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
 
[/color][/size][size=2][color=#0000ff]Me[/color][/size][size=2].Close()
 
[/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Sub
 
[/color][/size]
this works, you jes forgot minor things like If's here and proper End If's there... nothing major, the concept is fine ;)
 
Top Bottom