VISUAL BASIC 6

21/06/2006                                                                                    Page: 1

VISUAL BASIC 6

Project => Form => Components or Objects => Properties

Each user interface element has a set of definable properties which can be set at design time by using Properties window.

While creating a Labels a popup box appears called Sizing Box. The numbers in the sizing box give the horizontal and vertical dimensions and are in units of measure called Twips. A Twip is 1/20th of a Point. A Point is 1/72 of an Inch. So a Twip is 1/440 of an Inch.

An Image Object can display graphic formats like bmp, wmf, ico, cur, jpeg, gif. The Drive, Path, Filename Properties are available only at runtime. A common trait of animation is that the images move in relation to the predefined coordinate system which starts in upper left corner of a form. Default coordinate system is made up of rows and columns. We can define locations by identifying the intersection of rows and columns with notation of (x,y). Coordinates of upper left corner of form is always 0,0.

Moving Objects  In a coordinate system is like this => Object.move left top. We can use Move method to specify relative movement which is a distance the object should move from current location. Object.Move, Object.left -50. A picture box object is used with Move since it creates less flickers on screen than the image box object.

Example: Source.Visible=false. if Source.Tage=" " then image1.picture=image2.picture. picture1.visible = true. timer1.enabled =true end if. Type this code in the timer1.event => if picture1.top > 0 then picture1.move picture1.left -50, picture1.top -75 else picture1.visible=false timer1.enabled=false end if.

To expand or shrink object use height, width method.

Example: image1.height=image1.height+200                                                                            

 

General Coding for Drive, Directory, Filename 

Sub

Drive1_Change  Even{Dir1.Path  Drive1.Drive}

End Sub

 

Sub

Dir1_Change Event {File1.Path = Dir1.Path}

End Sub

 

Sub

File1_Click Event {SelectedFile = File1.Path & "\" &  File1.FileName; Image1.Picture=LoadPictures(SelectedFile);} 

End Sub

 

Home |  VB6-1 |  VB6-2 |  VB6-3 |  VB6-4 |  VB6-5 |  HTML-1 |  HTML-2 |

This site was last updated 06/21/06