sglPos = x + imgSplitter.Left
If sglPos < sglSplitLimit Then
picSplitter.Left = sglSplitLimit
ElseIf sglPos > Me.Width - sglSplitLimit Then
picSplitter.Left = Me.Width - sglSplitLimit
Else
picSplitter.Left = sglPos
End If
End If
End Sub
Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
SizeControls picSplitter.Left
picSplitter.Visible = False
mbMoving = False
End Sub
Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
If Source = imgSplitter Then
SizeControls x
End If
End Sub
Sub SizeControls(x As Single)
On Error Resume Next
'设置 Width 属性
If x < 1500 Then x = 1500
If x > (Me.Width - 1500) Then x = Me.Width - 1500
tvTreeView.Width = x
imgSplitter.Left = x
sstabView.Left = x + 40
sstabView.Width = Me.Width - (tvTreeView.Width + 140)
lblTitle(0).Width = tvTreeView.Width
' lblTitle(1).Left = lvMerch.Left + 20
' lblTitle(1).Width = lvMerch.Width - 40
'设置 Top 属性
If tbToolBar.Visible Then
tvTreeView.Top = tbToolBar.Height + picTitles.Height
Else
tvTreeView.Top = picTitles.Height
End If
sstabView.Top = tvTreeView.Top - picTitles.Height
'设置 height 属性
If sbStatusBar.Visible Then
tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height + sbStatusBar.Height)
Else
tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
End If
sstabView.Height = tvTreeView.Height + picTitles.Height
imgSplitter.Top = picTitles.Top
imgSplitter.Height = tvTreeView.Height
'修改ListView控件尺寸
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is ListView Then
ctl.Left = 0
ctl.Top = sstabView.TabHeight
ctl.Width = sstabView.Width - 40
ctl.Height = sstabView.Height - sstabView.TabHeight
ctl.Visible = False
End If
Next
sstabView_Click 0
End Sub
Private Sub lvBuy_DblClick()
mnuBuyModify_Click
End Sub
Private Sub lvDispose_DblClick()
mnuDisposeModify_Click
End Sub
Private Sub lvMerch_DblClick()
mnuMerc
Case 3
lvDispose.Visible = False
Case 4
lvProvider.Visible = False
End Select
Select Case sstabView.Tab
Case 0
lvMerch.Visible = True
lvMerch.SetFocus
Case 1
lvBuy.Visible = True
lvBuy.SetFocus