Visual Basic Black Book by Steven Holzner
Author:Steven Holzner
Language: eng
Format: epub
Tags: Visual Basic,
ITKnowledge
subscribe
login
search
My
ITKnowledge
FAQ/h
site map
contact us
Go!
Keyword
© Brief O Full
□ Advanced Search
□ Search Tips
Please Select
To access the contents, click the chapter and section titles. Visual Basic 6 Black Book
(Publisher: The Coriolis Group) Author(s): Steven Holzner ISBN: 1576102831 Publication Date: 08/01/98
Bookmark It
Search this book:
Go!
Drawing Boxes
You draw boxes in forms and picture boxes with the Line method, using the B argument:
object. Line [Step] ( xl, yl) [Step] ( x2, y2) , [color], [B][F] Here are the arguments you pass to Line:
• Step—Keyword specifying that the starting point coordinates are relative to the current graphics position given by the CurrentX and CurrentY properties.
• xl, yl —Single values indicating the coordinates of the starting point for the line or rectangle. The ScaleMode property determines the unit of measure used. If omitted, the line begins at the position indicated by CurrentX and CurrentY.
• Step—Keyword specifying that the end point coordinates are relative to the line starting point.
• x2, y>2 —Single values indicating the coordinates of the end point for the line being drawn.
• color —Long integer value indicating the RGB color used to draw the line. If omitted, the ForeColor property setting is used. You can use the RGB function or QBColor function to specify the color.
• B—If included, causes a box to be drawn using the coordinates to specify opposite corners of the box.
• F—If the B option is used, the F option specifies that the box is filled with the same color used to draw the box. You cannot use F without B. If B is used without F, the box is filled with the current FillColor and FillStyle. The default value for FillStyle is transparent.
Let's see an example showing how to draw boxes in forms and picture boxes when the user clicks a command button. In this case, we'll draw a box in a form
Private Sub Commandl_Click()
Line (ScaleWidth / 4, ScaleHeight / 4)-(3 * ScaleWidth / 4, 3 * _
file:///E|/Program%20Files/KaZaA/My%20Shared%...Basic%20-%20%20Black%20Book/ch18/593-596.html (1 of 3) [7/31/2001 9:02:04 AM]
Visual Basic 6 Black Book:Working With Graphics
ScaleHeight / 4) , , B
and another box in a picture box:
Private Sub Commandl_Click()
Line (ScaleWidth / 4, ScaleHeight / 4)-(3 * ScaleWidth / 4, 3 * _ ScaleHeight / 4), , B
Picturel.Line (Picturel.ScaleWidth / 4, Picturel.ScaleHeight / 4)-_ (3 * Picturel.ScaleWidth / 4, 3 * Picturel.ScaleHeight / 4), , B
End Sub
The result of this code appears in Figure 18.5. Now we're drawing boxes in Visual Basic.
□
Figure 18.5 Drawing boxes in forms and picture boxes. Drawing Circles
You use the Circle method to draw circles in forms and picture boxes:
object. Circle [Step] (x, y) , radius, [color, [start, end, [aspect]]] Here are the arguments you pass to Circle:
• Step—Keyword specifying that the center of the circle, ellipse, or arc is relative to the current coordinates given by the CurrentX and CurrentY properties of object.
• x, y —Single values indicating the coordinates for the center point of the circle, ellipse, or arc. The ScaleMode property of object determines the units of measure used.
• radius —Single value indicating the radius of the circle, ellipse, or arc. The ScaleMode property of object determines the unit of measure used.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(11897)
Hello! Python by Anthony Briggs(9373)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9343)
The Mikado Method by Ola Ellnestam Daniel Brolund(9307)
Dependency Injection in .NET by Mark Seemann(8859)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7852)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7324)
Grails in Action by Glen Smith Peter Ledbrook(7296)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7117)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5957)
Kotlin in Action by Dmitry Jemerov(4638)
Practical Vim (for Kathryn Amaral) by Drew Neil(3728)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(3596)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3417)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3243)
Learning Java by Patrick Niemeyer & Daniel Leuck(2872)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2839)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(2692)
Mastering Java 9 by Dr. Edward Lavieri(2573)