1 / 6

Drawing a Stick Figure!

Drawing a Stick Figure!. Create the follow form using code, draw a stick figure similar to the one shown here. Option Explicit Dim strcolor As String ____________________________ ScaleMode = vbPixels Line (80, 40)-(120, 80), strcolor, B Line (100, 80)-(100, 150), strcolor

ishana
Download Presentation

Drawing a Stick Figure!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Drawing a Stick Figure!

  2. Create the follow form using code, draw a stick figure similar to the one shown here.

  3. Option Explicit Dim strcolor As String ____________________________ ScaleMode = vbPixels Line (80, 40)-(120, 80), strcolor, B Line (100, 80)-(100, 150), strcolor Line (60, 105)-(140, 105), strcolor Line (60, 190)-(100, 150), strcolor Line (140, 190)-(100, 150), strcolor

  4. optBlack.Value = True ______________________________ strcolor = vbBlack ______________________________ strcolor = vbBlue ______________________________ strcolor = vbGreen ______________________________ strcolor = vbRed

  5. Summary • There are two ways to create lines on a forms. You can create a line control, or you can use the line method to draw a line on a form using Visual Basic code. • A Shape control is similar to a Line control except that the Shape control contains several additional properties, which allows you to change the shape and shading of the control. • The BorderColor and BorderWidth properties specify the color and width of ordinary lines and the color and width of border lines for a shape. The FillColor and FillStyle properties specify how a shape will be filled. • The properties of both Line controls and Shape controls cannot manipulate it. • Distance and position on a form is measured using coordinates. The top left corner of a form has the coordinates (0,0).

  6. All coordinates are positive. As you move toward the bottom of a form, the X-coordinate value increases. As you move toward the right of the form, the Y- coordinate value increases. • You specify where the Line method should draw a line by using specific coordinates. You can also specify the color of the line in the parameters. • The ScaleMethod property allows you to adjust the coordinate system of a form to be measured in twips, pixels, or points. • The Line method can also create boxes, either filled or unfilled.

More Related