|
-
Oct 26th, 2002, 03:40 PM
#1
Thread Starter
Frenzied Member
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?
-
Oct 26th, 2002, 03:44 PM
#2
Frenzied Member
VB Code:
StatusBar1.Panels(2).Text = "Hello"
-
Oct 28th, 2002, 07:57 AM
#3
VB Code:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private MachineName As String
Private UserAccount As String
Private Sub GetMachineName()
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetComputerName(sBuffer, lSize)
If lSize > 0 Then
MachineName = Left$(sBuffer, lSize)
Else
MachineName = vbNullString
End If
End Sub
Private Sub GetUserAccount()
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
UserAccount = Left$(sBuffer, lSize - 1)
Else
UserAccount = vbNullString
End If
End Sub
Private Sub Form_Load()
GetUserAccount
GetMachineName
StatusPanel1.Panels(2).Text = UserAccount
StatusPanel1.Panels(3).Text = MachineName
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|