INTRO:
In this tutorial we'll be learning how to make a shape change using a few Option Boxes.
------------------------------------------------------------------
GUI (LAYOUT):
Here is my GUI:
------------------------------------------------------------------
WHAT YOU NEED:
6 Option Buttons with:
#1 Option Button:
Name: Option1
Caption: Rectangle
#2 Option Button:
Name: Option2
Caption: Square
#3 Option Button:
Name: Option3
Caption: Oval
#4 Option Button:
Name: Option4
Caption: Circle
#5 Option Button:
Name: Option5
Caption: Rounded
#6 Option Button:
Name: Option6
Caption: Rounded2
1 Shape with:
Name: Shape1
Caption: (None)
----------------------------------------------------------------
CODE:
Quote:
Private Sub Option1_Click()
Shape1.Shape = 0
End Sub
Private Sub Option2_Click()
Shape1.Shape = 1
End Sub
Private Sub Option3_Click()
Shape1.Shape = 2
End Sub
Private Sub Option4_Click()
Shape1.Shape = 3
End Sub
Private Sub Option5_Click()
Shape1.Shape = 4
End Sub
Private Sub Option6_Click()
Shape1.Shape = 5
End Sub
|
The explanation is below.
----------------------------------------------------------------
CODE EXPLANATION:
Quote:
Private Sub Option1_Click()
Shape1.Shape = 0
End Sub
|
This tells VB to change Shape1 (Our shape) into the shape specified. All the other codes have the
EXACT same explanation!
REMEMBER: These are the values for each shape (Shape = ? - ? for the value for the shape)
Rectangle = 0
Square = 1
Oval = 2
Circle = 3
Rounded = 4
Rounded2 = 5
----------------------------------------------------------------
Thanks to TheComputerMaster/Tcm9669 for the screenshot program.
Special thanks to the readers (YOU).
Made by me, Travy92.
SAMPLES: