Shape control in Visual Basic 6.0


Shape control is used to draw different shapes on the form. Available shapes are:

  1. 0-RECTANGLE
  2. 1-SQUARE
  3. 2-OVAL
  4. 3-CIRCLE
  5. 4-ROUNDED  RECTANGLE
  6. 5-ROUNDED SQUARE

1.Start -> program-> Microsoft Visual Studio 6.0 -> Microsoft Visual Basic 6.0
2. Visual Basic load and appears on your screen.
3.Choose Standard Exe. From dialog box.

4.A form is open in the screen. Add Four command button on the form.

5. Change the caption property  of command1(Square),command2(oval),command3(Circle),command4(rounded).6

 

 

 

 

 

 

6.Open the code window from project window.Select the object from object dropdown list and tpye the code here as shown in figure below.

 

 

 

 

 

 

7.when the codding is complete .Run the program with  press<f5> key.

8.when you click on circle button acircle shape is shown on the form,if you click on rounded round rectange shape is shown on the form,if you click on sequare button asquare shape is shown on the form,if you click on ovel button then ovel shape is shown on the form like below in figure:

Comments are closed.