Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.Net... getting started

Status
Not open for further replies.

Fluoronator

Technical User
Jun 27, 2001
7
US
I've just installed VB.Net on my box and need a jumpstart... My first program was a simple "Beep()" and it did not work, can't find out why in the doc. Checked it in VB6 to make sure it wasn't my computer, no problems there. Next I was going to toggle the form's backcolor like this...

...Button1.Click...
If Me.BackColor = System.Drawing.Color.Red Then
Me.BackColor = System.Drawing.Color.Green
Else
Me.BackColor = System.Drawing.Color.Red
End If
End Sub
The "if" statement above is incorrect... Why?
 
Because backcolor is a Structure without a Compare interface. Try this.
' ToArgb produces an integer equivalent to Color
If Me.BackColor.ToArgb = System.Drawing.Color.Red.ToArgb Then
Me.BackColor = System.Drawing.Color.Green
Else
Me.BackColor = System.Drawing.Color.Red
End If

Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top