Step 2:
Application developed with Visual Basic, Part 3. |
3rd Step, modify the frmMain.frm
file
.
The
frmMain.frm file design, after modification.
![]() |
|||||
|
From the ...\VB
App\res folder copy the followihg files:
|
|
Private
Sub Form_Load() Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000) Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500) Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500) 'New setting size of frmMain Me.Height = Screen.Height - 500 Me.Width = Screen.Width Me.Top = 50 Me.Left = 0 'Load the icon - res/BookIco.ico file Set Me.Icon = LoadPicture(App.Path & "\res\BookIco.ico") 'Load the picture and size - ingraphic1.gif file Set Image1.Picture = LoadPicture(App.Path & "\res\ingraphic1.gif") Image1.Left = (Me.Width - Image1.Width) / 2 'Load the Caption value of Label and size - Lbword Lbword.Caption = "Learn how to write Visual Basic application ..." Lbword.Width = Me.Width - 235 Lbword.Top = Image1.Top + Image1.Height + 2 * (sbStatusBar.Top - (Image1.Top + Image1.Height + Lbword.Height)) / 3 End Sub ------------------------------------------------------------------------------- Private Sub Form_Unload(Cancel As Integer) Dim i As Integer 'close all sub forms For i = Forms.Count - 1 To 1 Step -1 Unload Forms(i) Next SaveSetting App.Title, "Settings", "MainLeft", Me.Left SaveSetting App.Title, "Settings", "MainTop", Me.Top SaveSetting App.Title, "Settings", "MainWidth", Me.Width SaveSetting App.Title, "Settings", "MainHeight", Me.Height End If End Sub ------------------------------------------------------------------------------ Private Sub mnuDataBook_Click() Dim f As New Book f.Show End Sub ------------------------------------------------------------------------------ Private Sub mnuFileExit_Click() 'unload the form Unload Me End Sub |