Public Event KeyDown(KeyCode As Integer, Shift As Integer)
Public Event KeyPress(KeyAscii As Integer)
Public Event KeyUp(KeyCode As Integer, Shift As Integer)
Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Property Get HeaderFont() As StdFont
Set HeaderFont = HeadPic.Font
End Property
Public Property Get ColumnFont() As StdFont
Set ColumnFont = CapPic.Font
End Property
Public Property Set ColumnFont(ByVal NewFont As StdFont)
Set CapPic.Font = NewFont
UserControl_Resize
PropertyChanged "ColumnFont"
End Property
Public Property Set HeaderFont(ByVal NewFont As StdFont)
Set HeadPic.Font = NewFont
UserControl_Resize
PropertyChanged "HeaderFont"
End Property
Private Sub Make3D(Obj As Object, BorderWidth As Double, Style As mBorderStyle, Optional LightColor As OLE_COLOR = &H80000016, Optional DarkColor As OLE_COLOR = &H80000010)
Dim DS, DW, SM
Dim K
Dim x2 As Long
Dim y2 As Long
Dim pixX As Integer
Dim pixY As Integer
pixX = Screen.TwipsPerPixelX
pixY = Screen.TwipsPerPixelY
x2 = Obj.Width - pixX
y2 = Obj.Height - pixY
DS = Obj.DrawStyle
DW = Obj.DrawWidth
SM = Obj.ScaleMode
Obj.DrawStyle = 0
Obj.DrawWidth = 1
Obj.ScaleMode = vbTwips
BorderWidth = BorderWidth * 20
If BorderWidth = 0 Then
BorderWidth = 50
End If
Select Case Style
Case 0 'Inset
'Upper border
For K = 0 To BorderWidth
Obj.Line (0, 0 + K)-(x2 - K, 0 + K), DarkColor
Next
'Right border
For K = 0 To BorderWidth
Obj.Line (x2 - K, 0 + K)-(x2 - K, y2), LightColor
Next
'Left border
For K = 0 To BorderWidth
Obj.Line (0 + K, 0)-(0 + K, y2 - K), DarkColor
Next
'Bottom border
For K = 0 To BorderWidth
Obj.Line (0 + K, y2 - K)-(x2, y2 - K), LightColor
Next
Case 1 'Raised
'Upper border
For K = 0 To BorderWidth
Obj.Line (0, 0 + K)-(x2 - K, 0 + K), LightColor
Next
'Right border
For K = 0 To BorderWidth
Obj.Line (x2 - K, 0 + K)-(x2 - K, y2), DarkColor
Next
'Left border
For K = 0 To BorderWidth
Obj.Line (0 + K, 0)-(0 + K, y2 - K), LightColor
Next
'Bottom border
For K = 0 To BorderWidth
Obj.Line (0 + K, y2 - K)-(x2, y2 - K), DarkColor
Next
End Select
Obj.DrawStyle = DS 'restore the settings
Obj.DrawWidth = DW
Obj.ScaleMode = SM
End Sub
Private Sub HScroll1_Change()
ListPic.Left = -HScroll1.Value * 100
CapPic.Left = ListPic.Left
DrawColCap
End Sub
Private Sub ListPic_Click()
RaiseEvent Click
End Sub
Private Sub ListPic_DblClick()
RaiseEvent DblClick
End Sub
Private Sub ListPic_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If ListPic.Enabled = True Then
Select Case KeyCode
Case 13
TxtEdit.Visible = False
SaveTxtEdit
Case 27
TxtEdit.Visible = False
Case 32
If MyMultiSelect = True Then
ItemSelected(MyListIndex) = Not ItemSelected(MyListIndex)
RefreshList
End If
Case 37
If HScroll1.Value <> 0 Then HScroll1.Value = HScroll1.Value - 1
Case 38
Me.ListIndex = Me.ListIndex - 1
Case 39
If HScroll1.Value <> HScroll1.Max Then HScroll1.Value = HScroll1.Value + 1
Case 40
If MyListIndex < ItemQty - 1 Then Me.ListIndex = Me.ListIndex + 1
End Select
RaiseEvent KeyDown(KeyCode, Shift)
End If
End Sub
Private Sub ListPic_KeyPress(KeyAscii As Integer)
If ListPic.Enabled = True Then RaiseEvent KeyPress(KeyAscii)
End Sub
Private Sub ListPic_KeyUp(KeyCode As Integer, Shift As Integer)
If ListPic.Enabled = True Then RaiseEvent KeyUp(KeyCode, Shift)
End Sub
Private Sub ListPic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim yPos As Long
Dim mPos As Integer
Dim TxtH As Long
TxtH = ListPic.TextHeight("X")
mPos = (Y - (TxtH / 2)) / TxtH
yPos = mPos * TxtH
If Button = 1 And TxtEdit.Visible = False And ListPic.Enabled = True Then
MyColIndex = FindCol(X)
If mPos < ItemQty Then
MyListIndex = mPos
If MyMultiSelect = True Then
ItemSelected(mPos) = Not ItemSelected(mPos)
End If
RefreshList
End If
ElseIf Button = 2 And MyListIndex > -1 And MyListEdit = True Then
HHHHHHHHHnoX = LitX =L= mighp (tie.Writ4List.Hy Get ColumnI)"6eal= mighp8i_&r)
PlumnI)"6
End Select
Endie.WistFont", Ambie,Pic.W0 r.dJ
Case 38
P pt Certy("ListFoCase 38aaaaaaaaaaaaaaaaaaaaaaltealtealHy Get ColuaaaaaaaaaaaaaaaaaaltealtealHy Get ColuaaaaaaaaaaaaaaaaaaltealtealHy Get ColuaaaaaaaaaaaaaaaaaaltealtealHy Get ColuaaaaaaaaaaaaaaaaaaltealtealHyGet ColumnI)"6eal= miWidth = PicConmlHyGet CoiWidth Widthteal ColLefteall1.Heigoperty Get ColumnCounsnd fContaineand folumnFhtealnGaltealHyGeineeightall0 'Inset
', BordeString
Dit4List.Hy Get ColumnI)"6eal= mighp8i_&r)ll1.HeigdeString
UserControl_Rtr.Hei)) / 2(aaaaaaaaaaaaag)derl = btNewValue > 20 Then
MsgBox "This Listelst.vanatd
glIdth - Ca("X"iht = itrty(aªDWd
glIdC)))))eerl = btNewValue > 20 Then
MsgBox "This - PicContainer.ic.dell14 AAAHeitionoltealte.Et =ubliH,,.Hei.H&l1.serControl_Rtr.Hei)) / 2(aaaaaaaaaaaaag)dericContainht = iteall14 AAAHeition.Hix04).nd P Cig)derxion.Hix04).nd P Cig)derxion.Hix04).nd P ell1M7th(TmpCHHHHHHHlue > lmtion.HiSJ-tidsSNewValue >ndex - aaiªDWids End If