Results 1 to 3 of 3

Thread: Status Bar Control... Altering text on a Panel?

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    Status Bar Control... Altering text on a Panel?

    Hey ya.

    When i do a different operation, i want to alter the text on panel two of my App, But, how do i do this?

    On panel 1 i always have the time, on panel two, i would like to add a username, and panel three, a ServerName etc.

    But, the "Dynamic" Text, i dont know how to do with a status bar.. ne help?
    Wayne

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    VB Code:
    1. StatusBar1.Panels(2).Text = "Hello"

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    2. Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    3.  
    4. Private MachineName As String
    5. Private UserAccount As String
    6.  
    7. Private Sub GetMachineName()
    8.     Dim sBuffer As String
    9.     Dim lSize As Long
    10.     sBuffer = Space$(255)
    11.     lSize = Len(sBuffer)
    12.  
    13.     Call GetComputerName(sBuffer, lSize)
    14.     If lSize > 0 Then
    15.         MachineName = Left$(sBuffer, lSize)
    16.     Else
    17.         MachineName = vbNullString
    18.     End If
    19.    
    20. End Sub
    21.  
    22. Private Sub GetUserAccount()
    23.  
    24.     Dim sBuffer As String
    25.     Dim lSize As Long
    26.    
    27.     sBuffer = Space$(255)
    28.     lSize = Len(sBuffer)
    29.     Call GetUserName(sBuffer, lSize)
    30.     If lSize > 0 Then
    31.         UserAccount = Left$(sBuffer, lSize - 1)
    32.     Else
    33.         UserAccount = vbNullString
    34.     End If
    35.    
    36. End Sub
    37.  
    38. Private Sub Form_Load()
    39. GetUserAccount
    40. GetMachineName
    41. StatusPanel1.Panels(2).Text = UserAccount
    42. StatusPanel1.Panels(3).Text = MachineName
    43. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width