Hour 6:
Application developed with Visual Basic, Part 15. |
9th Step, create the Biography.frm
file.
The Biography.frm design.
![]() |
|
|
Form1 |
. . . . . . . . |
Modify the Form Form1-
Form properties:
|
From File menu, choose Save
Project, the Save File As
dialog box appears( File Name box =
Biography) and then click Save.
From the ...\VB
App\res folder copy the followihg files:
|
|
|
View
Code,
examine these changes - the new text Code to be
add is red.
Dim IcoNmbr As Integer -------------------------------------------------------------------------------------------------------------------- Private Sub CmdDone_Click() Unload Me End Sub Private Sub Form_Load() -------------------------------------------------------------------------------------------------------------------- 'Load the icon - BookIco.ico Set Me.Icon = LoadPicture(App.Path & "\res\BookIco.ico") 'Load picture picico.Picture = LoadPicture(App.Path & "\res\butterfly1.bmp") picicoOrg(1).Picture = LoadPicture(App.Path & "\res\butterfly1.bmp") picicoOrg(2).Picture = LoadPicture(App.Path & "\res\butterfly2.bmp") IcoNmbr = 1 Timer1.Interval = 100 Timer1.Enabled = True End Sub -------------------------------------------------------------------------------------------------------------------- Private Sub Form_Resize() picico.Left = (Line1.X1 - picico.Width) / 2 picico.Top = picico.Height / 4 End Sub -------------------------------------------------------------------------------------------------------------------- Private Sub Timer1_Timer() picico.Picture = picicoOrg(IcoNmbr).Picture If IcoNmbr = 1 Then IcoNmbr = 2 Else IcoNmbr = 1 End If End Sub |
|
Private Sub
CmdCreated_Click() Dim f As New Biography f.Show End Sub -------------------------------------------------------------------------------------------------------------------- Private Sub CmdDone_Click() Unload Me End Sub -------------------------------------------------------------------------------------------------------------------- Private Sub Form_Load() 'Declare this variable Dim strdatasource As String 'Load the picture - diam1.bmp Set Image1.Picture = LoadPicture(App.Path & "\res\diam1.bmp") 'Load the icon - BookIco.ico Set Me.Icon = LoadPicture(App.Path & "\res\BookIco.ico") 'Value of strdatasource strdatasource = App.Path + "\res\KJV.mdb" 'AdRecordset1 - recordset and db1 - connection Dim AdRecordset1 As Recordset Dim db1 As Connection Set db1 = New Connection db1.CursorLocation = adUseClient db1.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & strdatasource Set AdRecordset1 = New Recordset AdRecordset1.Open "select TextData from BibleTable", db1, adOpenStatic, adLockOptimistic 'lbinfo.Caption display the information about KJV.mdb file. The 1st record of KJV.mdb store this information With AdRecordset1 .MoveFirst lbinfo.Caption = .Fields(0).Value End With End Sub |