Private Sub Form_Load()
Dim buf As String * 256
Dim return_len As Long
Dim wid1 As Single
Dim wid2 As Single
return_len = GetSystemDirectory(buf, Len(buf))
lblSystemDirectory.Caption = Left$(buf, return_len)
return_len = GetWindowsDirectory(buf, Len(buf))
lblWindowsDirectory.Caption = Left$(buf, return_len)
wid1 = lblWindowsDirectory.Left + _
lblWindowsDirectory.Width + Label1(0).Left
wid2 = lblSystemDirectory.Left + _
lblSystemDirectory.Width + Label1(0).Left
If wid1 > wid2 Then
Width = Width - ScaleWidth + wid1
Else
Width = Width - ScaleWidth + wid2
End If
End Sub
|