frmUserInfo.frm

 VERSION 5.00
Begin VB.Form frmUserInfo
   AutoRedraw      =   -1  'True
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   2565
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   6570
   ControlBox      =   0   'False
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2565
   ScaleWidth      =   6570
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin ChatTool.bgFrame bgFrameUserinformation
      Height          =   1245
      Left            =   240
      Top             =   465
      Width           =   6105
      _ExtentX        =   10769
      _ExtentY        =   2196
      Caption         =   "User information"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Begin VB.Label lblValue
         Caption         =   "Value:"
         BeginProperty Font
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   2805
         TabIndex        =   2
         Top             =   510
         Width           =   3135
      End
      Begin VB.Label lblName
         Caption         =   "Name:"
         BeginProperty Font
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   540
         TabIndex        =   0
         Top             =   510
         Width           =   2250
      End
   End
   Begin ChatTool.bgDugme bgCmdOk
      Height          =   435
      Left            =   2648
      TabIndex        =   1
      Top             =   1965
      Width           =   1275
      _ExtentX        =   2249
      _ExtentY        =   767
      Caption         =   "&Ok"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Object.Width           =   -1
   End
End
Attribute VB_Name = "frmUserInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Aktiv As Boolean
Private WithEvents cmdClose As VBControlExtender
Attribute cmdClose.VB_VarHelpID = -1
Public strActualServerTime As String
Public strChatname As String
Public strFullName As String
Public strUserName As String
Public strConnectionTime As String
Public strPCInactivityTime As String
Public strLastActiveChatToolTime As String
Public strPCName As String

Private Sub bgCmdOk_Click()
    Unload Me
End Sub

Private Sub cmdClose_ObjectEvent(Info As EventInfo)
    Unload Me
End Sub

Private Sub Form_activate()
    If Aktiv = False Then
        Aktiv = True
        LoadSkin Me, Active, True, LoadIt, 1
    Else
        LoadSkin Me, Active, False, LoadIt
    End If
End Sub

Private Sub Form_Deactivate()
    LoadSkin Me, NeActive, False, LoadIt
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyEscape: Unload Me
    End Select
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = vbLeftButton Then
        If y <= intCloseHeight And x < intCloseLeft Then
            WindowMove Me
        End If
    End If
    If Screen.MousePointer <> vbDefault Then Screen.MousePointer = vbDefault
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Aktiv = False
End Sub

Private Sub Form_Load()
    Dim i As Integer
    Aktiv = False
    Set cmdClose = Me.Controls.Add("ChatTool.bgclose", "cmdClose")
    cmdClose.Visible = True
End Sub

Public Sub LoadGUIText()
On Error GoTo err:
    Dim strTmpText As String
    Dim i As Integer
    Me.Caption = GetText(1508) 'Text: ChatTool - User information
    lblName(0).BackColor = Title.BackColor
    lblValue(0).BackColor = Title.BackColor
   
    strTmpText = GetText(1506) 'Text: User infomation retrieved at %1 (server time)
    strTmpText = Replace(strTmpText, "%1", FormatDateTime(strActualServerTime, vbShortDate) & " " & FormatDateTime(strActualServerTime, vbLongTime))
    bgFrameUserinformation.Caption = strTmpText
   
    NewLine GetText(1500), strChatname, 0 'Text: Nickname:
    NewLine GetText(1501), strFullName, 1 'Text: Real name:
    NewLine GetText(1502), strUserName, 2 'Text: Username:
    NewLine GetText(1509), strPCName, 3 'Text: PC name:
    NewLine GetText(1503), FormatDateTime(strConnectionTime, vbShortDate) & " " & FormatDateTime(strConnectionTime, vbLongTime), 4 'Text: Connection time:
    NewLine GetText(1505), FormatDateTime(strLastActiveChatToolTime, vbShortDate) & " " & FormatDateTime(strLastActiveChatToolTime, vbLongTime), 5 'Text: Last ChatTool activity:
    i = 6
    If strPCInactivityTime <> "" Then
        NewLine GetText(1504), FormatDateTime(strPCInactivityTime, vbShortDate) & " " & FormatDateTime(strPCInactivityTime, vbLongTime), i 'Text: PC inactivity start:
        i = i + 1
    End If
   
    bgFrameUserinformation.Height = lblName(i - 1).Top - lblName(0).Top + 1100

    Me.Height = bgFrameUserinformation.Height + 1200

    bgCmdOk.Top = bgFrameUserinformation.Height + bgFrameUserinformation.Top + 125

    bgCmdOk.Caption = GetText(1507) 'Text: &Ok
    Exit Sub
err:
    DebugLog "ERR - frmUserInfo - LoadGUIText - " & err.Description & " - " & err.Number
    Unload Me
End Sub

Private Sub NewLine(strName As String, strValue As String, index As Integer)
    If index > 0 Then
        Load lblName(index)
        Load lblValue(index)
        lblName(index).Top = lblName(index - 1).Top + 300
        lblName(index).Left = lblName(index - 1).Left
        lblValue(index).Top = lblValue(index - 1).Top + 300
        lblValue(index).Left = lblValue(index - 1).Left
    End If
    lblName(index).Caption = strName
    lblValue(index).Caption = strValue
    lblName(index).Visible = True
    lblValue(index).Visible = True
End Sub

Public Sub Init()
    Me.Left = frmChatTool.Left + Int((frmChatTool.Width - Me.Width) / 2)
    Me.Top = frmChatTool.Top + Int((frmChatTool.Height - Me.Height) / 2)
    LoadGUIText
    Me.Show vbModal
End Sub

Project Homepage: