Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home4/sambenne/public_html/samsvb/includes/dbc.php on line 3
Visual Basic 6 Tutorials

Lesson 10 Shapes

This is will be an easy tutorial because shapes are very easy to use. First create a shape by clicking and dragging the component. Then once you have the shape you can edit it to make it look like the one you need so first if you want color make sure that it is opaque not transparent. Then you can choose your color by selecting a back color and finally make it to your right size. If your not after the default rectangle then you can change the shape.
Example shape
Now to add some code so that you can have something to do with shapes. so add a shape and call it "shpChange" and add a button and a text box.
What we are going to do is use the if command from the tutorial before this one and make the shape change color so copy and paste this.
Private Sub Command1_Click()
If Text1.Text = "blue" Then
shpChange.BackColor = vbBlue
ElseIf Text1.Text = "red" Then
shpChange.BackColor = vbRed
End If
End Sub

You can now type blue or red into the text box hit the button and see the shape change color.
Example shape

Example shape