Page 42 - Open Soource Technologies 304.indd
P. 42
Event Driven Programming
professional. Textboxes can be used to store there name and other details, make sure you put
a picture box in for a picture of the house.
Now insert the following source code for your application. Private Sub Form_Load()
Picture1.Picture = LoadPicture(“C:\Program Files\VB\Graphics\Icons\Misc\MISC42.ICO”)
End Sub
3.1.6 Running and Viewing the Project in Detail
Once an application is loaded it can be run by click on the icon from the tool bar, to pause
press and to terminate use .
Once a project is loaded, the name of the form(s) that it contains is displayed in the project
window. To view a form in design mode, select the form required by clicking with the mouse
to highlight its name, then clicking on the view form button.
Os file name
View Form
View Code
Name of object
Figure 3.4: Tool Box view of Project.
In this example the project has been loaded and the maillist.frm has been selected for viewing.
This Ms Mail example project useds 6 forms and 1 modules.
In Design mode, when the form is viewed, the code attached to any screen object may be
inspected by double clicking on that object. The screen shots below show the interface of the Ms
Mail example (.../samples/Comtool/VBMail/MaiLLST.FRM) to view the code for this form select
from the project window item.
Private Sub SetupOptionForm(BasePic As Control)
BasePic.Top = 0
BasePic.Left = 0
BasePic.Visible = True
BasePic.enabled = True
OKBt.Top = BasePic.Height + 120
Me.width = BasePic.Width + 120
Me.Heigh = OkBt.Top + OkBt.Height + 495
End Sub
36 LOVELY PROFESSIONAL UNIVERSITY