VBSlip 15_1_2015-16



=================================Slip15_1=================================
Write a VB Program to create status bar and display it on onto the form. Status bar should have five panels to display any text, date, time, CAPS ON/OFF, NumLock ON/Off.
.============================================================================================
 


Private Declare Function GetKeyState Lib "user32" (ByValnVirtKey As Long) As Integer
Private Sub Form_Load()
                StatusBar1.Panels(1) = "HI"

                StatusBar1.Panels(2) = Date
                StatusBar1.Panels(3) = Time
End Sub

Private Sub Timer1_Timer()
                If GetKeyState(vbKeyCapital) = 0 Then
                                StatusBar1.Panels(4) = "CAPS OFF"
                Else
                                StatusBar1.Panels(4) = "CAPS ON"
                End If
                If GetKeyState(vbKeyNumlock) = 0 Then
                                StatusBar1.Panels(5) = "NUM LOCK OFF"
                Else
                                StatusBar1.Panels(5) = "NUM LOCK ON"
                End If
               
End Sub
 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.