Application developed with Visual Basic, Part 17.


10th Step, Activate the StatusBar control.

Resume :

  1. The frmMain.frm View Code.

    Examine these changes - the new text Code to be add is red.

    Private Sub Form_Load()

    '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.jpg file
    Set Image1.Picture = LoadPicture(App.Path & "\res\ingraphic1.jpg")
    Image1.Left = (Me.Width - Image1.Width) / 2

    'Load the Caption value of Label and size - Lbword
    Lbword.Caption = "In the beginning was the Word, and the Word was with God, and the Word was God."
    Lbword.Width = Me.Width - 235
    Lbword.Top = Image1.Top + Image1.Height + 2 * (sbStatusBar.Top - (Image1.Top + Image1.Height + Lbword.Height)) / 3
    'The statusBar value by default
    sbStatusBar.Panels.Item(1).Text = "Hello ..."
    End Sub

    ----------------------------------------------------------------------------------------------------------------------
    Private Sub Form_Unload(Cancel As Integer)
    (.................)

    End Sub

    ----------------------------------------------------------------------------------------------------------------------
    Private Sub mnuAbout_Click()
    Dim f As New About
    'To call About Form
    sbStatusBar.Panels.Item(1).Text = "About ..."
    f.Show
    End Sub
    ----------------------------------------------------------------------------------------------------------------------
    Private Sub mnuDataBook_Click()
    Dim f As New Book
    'To call Book Form
    sbStatusBar.Panels.Item(1).Text = "one moment"
    f.Show
    End Sub

    ----------------------------------------------------------------------------------------------------------------------
    Private Sub mnuFileExit_Click()
    'To call Exit command
    sbStatusBar.Panels.Item(1).Text = "Exit ..."
    'unload the form
    Unload Me

    End Sub


  2. The Book.frm View Code.

    Examine these changes - the new text Code to be add is red.

    Dim WithEvents adoPrimaryRS As Recordset

    'Type of AdRecordset1
    Dim AdRecordset1 As Recordset

    ' Type of strdatasource
    Dim strdatasource As String

    Dim recordno As Long
    ----------------------------------------------------------------------------------------------------------------------
    Private Sub Cmbbook_Click()

    (.................)

    End Sub
    ----------------------------------------------------------------------------------------------------------------------
    Private Sub Cmbchapter_Click()

    (.................)

    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub Cmbtitle_Click()

    (.................)

    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub Cmbverse_Click()
    (.................)
    End Sub
    -----------------------------------------------------------------------------------------------------------------------
    Private Sub CmdAbout_Click()
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub cmddisplay_Click()
    (.................)

    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub cmddisplay_GotFocus()
    (.................)
    End Sub
    -----------------------------------------------------------------------------------------------------------------------
    Private Sub Form_Load()
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub Form_Resize()
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub Form_Unload(Cancel As Integer)
    Screen.MousePointer = vbDefault
    'To close the current form
    fMainForm.sbStatusBar.Panels.Item(1).Text = "Hello ..."
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
    '(.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub cmdClose_Click()
    'To close the current form
    fMainForm.sbStatusBar.Panels.Item(1).Text = "Hello ..."
    Unload Me
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub cmdFirst_Click()
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub cmdLast_Click()
    (.................)

    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub cmdNext_Click()
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub cmdPrevious_Click()
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub SetButtons(bVal As Boolean)
    (.................)
    End Sub
    -----------------------------------------------------------------------------------------------------------------------
    Private Sub Settitle(bVal As Boolean)
    (.................)
    End Sub
    -----------------------------------------------------------------------------------------------------------------------

    Private Sub Setbook(bVal As Boolean)
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub Setchapter(bVal As Boolean)
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub Setverse(bVal As Boolean)
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------

    Private Sub List1_Click()

    (.................)
    End Sub
    -----------------------------------------------------------------------------------------------------------------------
    'Calcul the values of book, title, chapter and verse
    Private Sub LabelAddress()
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub TabStrip1_Click()
    (.................)
    End Sub

    -----------------------------------------------------------------------------------------------------------------------
    Private Sub TxtWord_KeyPress(KeyAscii As Integer)
    (.................)
    End Sub


  3. The About.frm View Code.

    Examine these changes - the new text Code to be add is red.

    Private Sub CmdDone_Click()
    'To close the current form
    fMainForm.sbStatusBar.Panels.Item(1).Text = "Hello ..."
    Unload Me
    End Sub

    --------------------------------------------------------------------------------------------------------------------
    Private Sub Form_Load()
    (.................)
    End Sub

    --------------------------------------------------------------------------------------------------------------------
    Private Sub Form_Unload(Cancel As Integer)
    'To close the current form
    fMainForm.sbStatusBar.Panels.Item(1).Text = "Hello ..."
    End Sub

     

  4. To save this application; From File menu, choose and click Save Project.
  5. To run it; From Run menu, choose and click Start.

     

    Note

    The analogue application. stoerd in the folder Visual_Basic\VB App. For more information, read the readmeVB.htm file


Previous
Home 17 Home