📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BackColor = &H8000000B&
Caption = "Form1"
ClientHeight = 5460
ClientLeft = 60
ClientTop = 345
ClientWidth = 6555
LinkTopic = "Form1"
ScaleHeight = 5460
ScaleWidth = 6555
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
Height = 5235
Left = 120
ScaleHeight = 5175
ScaleWidth = 1875
TabIndex = 0
Top = 120
Width = 1935
Begin VB.CommandButton cmdMainWork
Caption = "Command1"
Height = 375
Index = 0
Left = 0
TabIndex = 1
Top = 0
UseMaskColor = -1 'True
Visible = 0 'False
Width = 1875
End
Begin VB.Label lblWork
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "Label1"
Height = 375
Index = 0
Left = 0
MousePointer = 3 'I-Beam
TabIndex = 2
Top = 420
Width = 1875
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim isTop(100) As Boolean, LanguageType As String
Private Sub cmdMainWork_Click(Index As Integer)
Dim i As Integer
For i = Index + 1 To Me.cmdMainWork.Count - 1
If isTop(i) = True Then
cmdMoveNext i, Me.cmdMainWork.Count
isTop(i) = False
End If
Next
If isTop(Index) = False Then
cmdMoveTop Index, Me.cmdMainWork.Count
isTop(Index) = True
End If
LoadlblWork (Index)
End Sub
Private Sub cmdMoveTop(cmdIndex As Integer, MaxIndex As Integer)
'该对象以上的对象全向上移动
Dim i As Integer
For i = 0 To cmdIndex
Me.cmdMainWork(i).Top = Me.Picture1.Top + i * Me.cmdMainWork(i).Height - 120
Next
End Sub
Private Sub cmdMoveNext(cmdIndex As Integer, MaxIndex As Integer)
'对象向下移动
Me.cmdMainWork(cmdIndex).Top = Me.Picture1.Height - (MaxIndex - cmdIndex) * Me.cmdMainWork(cmdIndex).Height - 60
End Sub
Function LoadLg(strOldCaption As String) As String
Dim rst As Recordset, strSelect As String
strSelect = "Select " & LanguageType & " from ResourceFile Where aa='" & strOldCaption & "'"
Set rst = New Recordset
rst.Open strSelect, GetConnect, adOpenForwardOnly
If rst.EOF = False Then
LoadLg = rst.Fields(LanguageType)
End If
End Function
Private Sub Form_Load()
'Dim i As Integer, rstUserWork As Recordset
'
'LanguageType = "aa"
'
''加载任务栏
'Set rstUserWork = New Recordset
'rstUserWork.Open "SELECT UserWork.WorkType From UserWork GROUP BY UserWork.WorkType Order by first(WTOrderBy);", GetConnect, adOpenForwardOnly
'i = 0
'Do Until rstUserWork.EOF
' If i <> 0 Then
' Load Me.cmdMainWork(i)
' End If
' Me.cmdMainWork(i).Visible = True
' Me.cmdMainWork(i).Top = Me.cmdMainWork(0).Height * (i)
' Me.cmdMainWork(i).Caption = rstUserWork![WorkType]
' rstUserWork.MoveNext
' i = i + 1
'Loop
'
''初始化任务栏状态
'For i = 0 To Me.cmdMainWork.Count - 1
' isTop(i) = True
'Next
End Sub
Private Sub LoadlblWork(cmdIndex As Integer)
Dim rstWork As Recordset, i As Integer
For i = 1 To Me.lblWork.Count - 1
Unload Me.lblWork(i)
Next
Me.lblWork(0).Visible = False
Set rstWork = New Recordset
rstWork.Open "Select UserJob From UserWork Where WorkType='" & Me.cmdMainWork(cmdIndex).Caption & "' Order by UJOrderBy", GetConnect, adOpenForwardOnly
i = 0
Do Until rstWork.EOF
If i <> 0 Then
Load lblWork(i)
End If
Me.lblWork(i).Visible = True
Me.lblWork(i).Appearance = 0
Me.lblWork(i).BackColor = &H8000000C
Me.lblWork(i).BackStyle = 1
Me.lblWork(i).BorderStyle = 0
Me.lblWork(i).AutoSize = False
Me.lblWork(i).Caption = rstWork![UserJob]
Me.lblWork(i).Top = Me.cmdMainWork(cmdIndex).Top + Me.cmdMainWork(cmdIndex).Height + Me.lblWork(0).Height * (i)
i = i + 1
rstWork.MoveNext
Loop
End Sub
Private Sub lblWork_Click(Index As Integer)
Dim i As Integer
'MsgBox "1213120"
For i = 0 To Index - 1
Me.lblWork(i).Appearance = 0
Me.lblWork(i).BackColor = &H8000000C
Me.lblWork(i).BackStyle = 1
Me.lblWork(i).BorderStyle = 0
Me.lblWork(i).AutoSize = False
Next
Me.lblWork(Index).Appearance = 1
Me.lblWork(Index).BackColor = &H8000000C
Me.lblWork(Index).BackStyle = 1
Me.lblWork(Index).BorderStyle = 1
Me.lblWork(Index).AutoSize = False
For i = Index + 1 To Me.lblWork.Count - 1
Me.lblWork(i).Appearance = 0
Me.lblWork(i).BackColor = &H8000000C
Me.lblWork(i).BackStyle = 1
Me.lblWork(i).BorderStyle = 0
Me.lblWork(i).AutoSize = False
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -