home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Multi_Colu632573182002.psc / ListBox.ctl < prev   
Encoding:
Visual Basic user-defined control file  |  2002-03-19  |  57.7 KB  |  1,743 lines

  1. VERSION 5.00
  2. Begin VB.UserControl CoolListBox 
  3.    BackStyle       =   0  'Transparent
  4.    ClientHeight    =   6180
  5.    ClientLeft      =   0
  6.    ClientTop       =   0
  7.    ClientWidth     =   5115
  8.    PropertyPages   =   "ListBox.ctx":0000
  9.    ScaleHeight     =   6180
  10.    ScaleWidth      =   5115
  11.    ToolboxBitmap   =   "ListBox.ctx":005C
  12.    Begin VB.PictureBox PicBorder 
  13.       AutoRedraw      =   -1  'True
  14.       BackColor       =   &H00C0C0C0&
  15.       BorderStyle     =   0  'None
  16.       Height          =   5910
  17.       Left            =   180
  18.       ScaleHeight     =   5910
  19.       ScaleWidth      =   4785
  20.       TabIndex        =   0
  21.       Top             =   135
  22.       Width           =   4785
  23.       Begin VB.PictureBox PicContainer 
  24.          AutoRedraw      =   -1  'True
  25.          BackColor       =   &H80000005&
  26.          BorderStyle     =   0  'None
  27.          Height          =   5055
  28.          Left            =   315
  29.          ScaleHeight     =   5055
  30.          ScaleWidth      =   4335
  31.          TabIndex        =   1
  32.          Top             =   405
  33.          Width           =   4335
  34.          Begin VB.HScrollBar HScroll1 
  35.             Height          =   240
  36.             LargeChange     =   10
  37.             Left            =   540
  38.             Max             =   0
  39.             TabIndex        =   27
  40.             TabStop         =   0   'False
  41.             Top             =   3735
  42.             Visible         =   0   'False
  43.             Width           =   2490
  44.          End
  45.          Begin VB.PictureBox CapPic 
  46.             AutoRedraw      =   -1  'True
  47.             BorderStyle     =   0  'None
  48.             FillColor       =   &H8000000F&
  49.             Height          =   870
  50.             Left            =   180
  51.             ScaleHeight     =   870
  52.             ScaleWidth      =   4110
  53.             TabIndex        =   6
  54.             Top             =   405
  55.             Visible         =   0   'False
  56.             Width           =   4110
  57.             Begin VB.PictureBox CapSep 
  58.                AutoRedraw      =   -1  'True
  59.                BackColor       =   &H00000000&
  60.                BorderStyle     =   0  'None
  61.                Height          =   285
  62.                Index           =   19
  63.                Left            =   3690
  64.                ScaleHeight     =   285
  65.                ScaleWidth      =   60
  66.                TabIndex        =   26
  67.                Top             =   405
  68.                Visible         =   0   'False
  69.                Width           =   60
  70.             End
  71.             Begin VB.PictureBox CapSep 
  72.                AutoRedraw      =   -1  'True
  73.                BackColor       =   &H00000000&
  74.                BorderStyle     =   0  'None
  75.                Height          =   285
  76.                Index           =   18
  77.                Left            =   3510
  78.                ScaleHeight     =   285
  79.                ScaleWidth      =   60
  80.                TabIndex        =   25
  81.                Top             =   405
  82.                Visible         =   0   'False
  83.                Width           =   60
  84.             End
  85.             Begin VB.PictureBox CapSep 
  86.                AutoRedraw      =   -1  'True
  87.                BackColor       =   &H00000000&
  88.                BorderStyle     =   0  'None
  89.                Height          =   285
  90.                Index           =   17
  91.                Left            =   3330
  92.                ScaleHeight     =   285
  93.                ScaleWidth      =   60
  94.                TabIndex        =   24
  95.                Top             =   405
  96.                Visible         =   0   'False
  97.                Width           =   60
  98.             End
  99.             Begin VB.PictureBox CapSep 
  100.                AutoRedraw      =   -1  'True
  101.                BackColor       =   &H00000000&
  102.                BorderStyle     =   0  'None
  103.                Height          =   285
  104.                Index           =   16
  105.                Left            =   3150
  106.                ScaleHeight     =   285
  107.                ScaleWidth      =   60
  108.                TabIndex        =   23
  109.                Top             =   405
  110.                Visible         =   0   'False
  111.                Width           =   60
  112.             End
  113.             Begin VB.PictureBox CapSep 
  114.                AutoRedraw      =   -1  'True
  115.                BackColor       =   &H00000000&
  116.                BorderStyle     =   0  'None
  117.                Height          =   285
  118.                Index           =   15
  119.                Left            =   2970
  120.                ScaleHeight     =   285
  121.                ScaleWidth      =   60
  122.                TabIndex        =   22
  123.                Top             =   405
  124.                Visible         =   0   'False
  125.                Width           =   60
  126.             End
  127.             Begin VB.PictureBox CapSep 
  128.                AutoRedraw      =   -1  'True
  129.                BackColor       =   &H00000000&
  130.                BorderStyle     =   0  'None
  131.                Height          =   285
  132.                Index           =   14
  133.                Left            =   2790
  134.                ScaleHeight     =   285
  135.                ScaleWidth      =   60
  136.                TabIndex        =   21
  137.                Top             =   405
  138.                Visible         =   0   'False
  139.                Width           =   60
  140.             End
  141.             Begin VB.PictureBox CapSep 
  142.                AutoRedraw      =   -1  'True
  143.                BackColor       =   &H00000000&
  144.                BorderStyle     =   0  'None
  145.                Height          =   285
  146.                Index           =   13
  147.                Left            =   2070
  148.                ScaleHeight     =   285
  149.                ScaleWidth      =   60
  150.                TabIndex        =   20
  151.                Top             =   405
  152.                Visible         =   0   'False
  153.                Width           =   60
  154.             End
  155.             Begin VB.PictureBox CapSep 
  156.                AutoRedraw      =   -1  'True
  157.                BackColor       =   &H00000000&
  158.                BorderStyle     =   0  'None
  159.                Height          =   285
  160.                Index           =   12
  161.                Left            =   2250
  162.                ScaleHeight     =   285
  163.                ScaleWidth      =   60
  164.                TabIndex        =   19
  165.                Top             =   405
  166.                Visible         =   0   'False
  167.                Width           =   60
  168.             End
  169.             Begin VB.PictureBox CapSep 
  170.                AutoRedraw      =   -1  'True
  171.                BackColor       =   &H00000000&
  172.                BorderStyle     =   0  'None
  173.                Height          =   285
  174.                Index           =   11
  175.                Left            =   2430
  176.                ScaleHeight     =   285
  177.                ScaleWidth      =   60
  178.                TabIndex        =   18
  179.                Top             =   405
  180.                Visible         =   0   'False
  181.                Width           =   60
  182.             End
  183.             Begin VB.PictureBox CapSep 
  184.                AutoRedraw      =   -1  'True
  185.                BackColor       =   &H00000000&
  186.                BorderStyle     =   0  'None
  187.                Height          =   285
  188.                Index           =   10
  189.                Left            =   2610
  190.                ScaleHeight     =   285
  191.                ScaleWidth      =   60
  192.                TabIndex        =   17
  193.                Top             =   405
  194.                Visible         =   0   'False
  195.                Width           =   60
  196.             End
  197.             Begin VB.PictureBox CapSep 
  198.                AutoRedraw      =   -1  'True
  199.                BackColor       =   &H00000000&
  200.                BorderStyle     =   0  'None
  201.                Height          =   285
  202.                Index           =   9
  203.                Left            =   1890
  204.                ScaleHeight     =   285
  205.                ScaleWidth      =   60
  206.                TabIndex        =   16
  207.                Top             =   405
  208.                Visible         =   0   'False
  209.                Width           =   60
  210.             End
  211.             Begin VB.PictureBox CapSep 
  212.                AutoRedraw      =   -1  'True
  213.                BackColor       =   &H00000000&
  214.                BorderStyle     =   0  'None
  215.                Height          =   285
  216.                Index           =   8
  217.                Left            =   1710
  218.                ScaleHeight     =   285
  219.                ScaleWidth      =   60
  220.                TabIndex        =   15
  221.                Top             =   405
  222.                Visible         =   0   'False
  223.                Width           =   60
  224.             End
  225.             Begin VB.PictureBox CapSep 
  226.                AutoRedraw      =   -1  'True
  227.                BackColor       =   &H00000000&
  228.                BorderStyle     =   0  'None
  229.                Height          =   285
  230.                Index           =   7
  231.                Left            =   1530
  232.                ScaleHeight     =   285
  233.                ScaleWidth      =   60
  234.                TabIndex        =   14
  235.                Top             =   405
  236.                Visible         =   0   'False
  237.                Width           =   60
  238.             End
  239.             Begin VB.PictureBox CapSep 
  240.                AutoRedraw      =   -1  'True
  241.                BackColor       =   &H00000000&
  242.                BorderStyle     =   0  'None
  243.                Height          =   285
  244.                Index           =   6
  245.                Left            =   1350
  246.                ScaleHeight     =   285
  247.                ScaleWidth      =   60
  248.                TabIndex        =   13
  249.                Top             =   405
  250.                Visible         =   0   'False
  251.                Width           =   60
  252.             End
  253.             Begin VB.PictureBox CapSep 
  254.                AutoRedraw      =   -1  'True
  255.                BackColor       =   &H00000000&
  256.                BorderStyle     =   0  'None
  257.                Height          =   285
  258.                Index           =   5
  259.                Left            =   1170
  260.                ScaleHeight     =   285
  261.                ScaleWidth      =   60
  262.                TabIndex        =   12
  263.                Top             =   405
  264.                Visible         =   0   'False
  265.                Width           =   60
  266.             End
  267.             Begin VB.PictureBox CapSep 
  268.                AutoRedraw      =   -1  'True
  269.                BackColor       =   &H00000000&
  270.                BorderStyle     =   0  'None
  271.                Height          =   285
  272.                Index           =   4
  273.                Left            =   990
  274.                ScaleHeight     =   285
  275.                ScaleWidth      =   60
  276.                TabIndex        =   11
  277.                Top             =   405
  278.                Visible         =   0   'False
  279.                Width           =   60
  280.             End
  281.             Begin VB.PictureBox CapSep 
  282.                AutoRedraw      =   -1  'True
  283.                BackColor       =   &H00000000&
  284.                BorderStyle     =   0  'None
  285.                Height          =   285
  286.                Index           =   3
  287.                Left            =   810
  288.                ScaleHeight     =   285
  289.                ScaleWidth      =   60
  290.                TabIndex        =   10
  291.                Top             =   405
  292.                Visible         =   0   'False
  293.                Width           =   60
  294.             End
  295.             Begin VB.PictureBox CapSep 
  296.                AutoRedraw      =   -1  'True
  297.                BackColor       =   &H00000000&
  298.                BorderStyle     =   0  'None
  299.                Height          =   285
  300.                Index           =   2
  301.                Left            =   630
  302.                ScaleHeight     =   285
  303.                ScaleWidth      =   60
  304.                TabIndex        =   9
  305.                Top             =   405
  306.                Visible         =   0   'False
  307.                Width           =   60
  308.             End
  309.             Begin VB.PictureBox CapSep 
  310.                AutoRedraw      =   -1  'True
  311.                BackColor       =   &H00000000&
  312.                BorderStyle     =   0  'None
  313.                Height          =   285
  314.                Index           =   1
  315.                Left            =   450
  316.                ScaleHeight     =   285
  317.                ScaleWidth      =   60
  318.                TabIndex        =   8
  319.                Top             =   405
  320.                Visible         =   0   'False
  321.                Width           =   60
  322.             End
  323.             Begin VB.PictureBox CapSep 
  324.                AutoRedraw      =   -1  'True
  325.                BackColor       =   &H00000000&
  326.                BorderStyle     =   0  'None
  327.                Height          =   285
  328.                Index           =   0
  329.                Left            =   270
  330.                ScaleHeight     =   285
  331.                ScaleWidth      =   60
  332.                TabIndex        =   7
  333.                Top             =   405
  334.                Visible         =   0   'False
  335.                Width           =   60
  336.             End
  337.          End
  338.          Begin VB.PictureBox HeadPic 
  339.             AutoRedraw      =   -1  'True
  340.             BorderStyle     =   0  'None
  341.             FillColor       =   &H8000000F&
  342.             Height          =   285
  343.             Left            =   0
  344.             ScaleHeight     =   285
  345.             ScaleWidth      =   1725
  346.             TabIndex        =   5
  347.             Top             =   0
  348.             Width           =   1725
  349.          End
  350.          Begin VB.VScrollBar VScroll1 
  351.             Height          =   2715
  352.             LargeChange     =   10
  353.             Left            =   4095
  354.             Max             =   0
  355.             TabIndex        =   4
  356.             TabStop         =   0   'False
  357.             Top             =   990
  358.             Visible         =   0   'False
  359.             Width           =   240
  360.          End
  361.          Begin VB.PictureBox ListPic 
  362.             AutoRedraw      =   -1  'True
  363.             BackColor       =   &H80000005&
  364.             BorderStyle     =   0  'None
  365.             DrawStyle       =   5  'Transparent
  366.             FillStyle       =   0  'Solid
  367.             Height          =   2670
  368.             Left            =   495
  369.             ScaleHeight     =   2670
  370.             ScaleWidth      =   2265
  371.             TabIndex        =   3
  372.             Top             =   765
  373.             Width           =   2265
  374.             Begin VB.TextBox TxtEdit 
  375.                Appearance      =   0  'Flat
  376.                BorderStyle     =   0  'None
  377.                Height          =   150
  378.                Left            =   180
  379.                TabIndex        =   28
  380.                Top             =   450
  381.                Visible         =   0   'False
  382.                Width           =   1545
  383.             End
  384.          End
  385.          Begin VB.PictureBox BackPic 
  386.             AutoSize        =   -1  'True
  387.             BorderStyle     =   0  'None
  388.             Height          =   1140
  389.             Left            =   2610
  390.             ScaleHeight     =   1140
  391.             ScaleWidth      =   1725
  392.             TabIndex        =   2
  393.             Top             =   45
  394.             Visible         =   0   'False
  395.             Width           =   1725
  396.          End
  397.       End
  398.    End
  399. End
  400. Attribute VB_Name = "CoolListBox"
  401. Attribute VB_GlobalNameSpace = False
  402. Attribute VB_Creatable = True
  403. Attribute VB_PredeclaredId = False
  404. Attribute VB_Exposed = True
  405. Attribute VB_Ext_KEY = "PropPageWizardRun" ,"Yes"
  406. Option Explicit
  407.  
  408. Private Enum mBorderStyle
  409.     mInsert
  410.     mRaised
  411. End Enum
  412.  
  413. Public Enum mScrollAuto
  414.     Horizontal
  415.     Vertical
  416.     Both
  417. End Enum
  418.  
  419. Public Enum mBackPicStyle
  420.     Normal
  421.     Tile
  422.     Stretch
  423. End Enum
  424.  
  425. Public Enum mListBorder
  426.     None
  427.     SmoothInsert
  428.     SmoothRaised
  429.     Insert
  430.     Raised
  431.     Frame
  432.     Groove
  433. End Enum
  434.  
  435. Dim MyItem() As String
  436. Dim ItemSelected() As Boolean
  437. Dim ItemQty As Long
  438. Dim MaxVQty As Integer
  439. Dim MyMultiSelect As Boolean
  440. Dim MyItemSel As Long
  441. Dim I As Integer
  442. Dim MyListIndex As Long
  443. Dim FocusGot As Boolean
  444. Dim MyScrollAuto As mScrollAuto
  445. Dim MyColSeparator As String
  446. Dim MyHeadCaption As String
  447. Dim MyHeadAlign As AlignmentConstants
  448. Dim MyColWidth As String
  449. Dim MyColCaption As String
  450. Dim MyColCapAlign As String
  451. Dim MyColListAlign As String
  452. Dim MyColCount As Integer
  453. Dim TotalColWidth As Long
  454. Dim MyColIndex As Integer
  455. Dim MyListEdit As Boolean
  456. Dim MyIntegralHeight As Boolean
  457. Dim MyBackPicStyle As mBackPicStyle
  458.  
  459. Dim MyHeaderBorder As mListBorder
  460. Dim MyColumnBorder As mListBorder
  461. Dim MyListBorder As mListBorder
  462. Dim MyControlBorder As mListBorder
  463.  
  464. Dim MyTextColor As OLE_COLOR
  465. Dim MySelectedColor As OLE_COLOR
  466. Dim MySelectedTextColor As OLE_COLOR
  467. Dim MyMultiSelTextColor As OLE_COLOR
  468. Dim MyMultiNotSelTextColor As OLE_COLOR
  469.  
  470. Const defCaption = "Col 1ªCol 2ªCol 3ªCol 4ªCol 5ªCol 6ªCol 7ªCol 8ªCol 9ªCol 10ªCol 11ªCol 12ªCol 13ªCol 14ªCol 15ªCol 16ªCol 17ªCol 18ªCol 19ªCol 20"
  471. Const defWidth = "1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000ª1000"
  472. Const defCapAlign = "0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0"
  473. Const defListAlign = "0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0ª0"
  474.  
  475. Public Event Click()
  476. Public Event DblClick()
  477. Public Event KeyDown(KeyCode As Integer, Shift As Integer)
  478. Public Event KeyPress(KeyAscii As Integer)
  479. Public Event KeyUp(KeyCode As Integer, Shift As Integer)
  480. Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  481. Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  482. Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  483. Public Property Get HeaderFont() As StdFont
  484. Set HeaderFont = HeadPic.Font
  485. End Property
  486.  
  487. Public Property Get ColumnFont() As StdFont
  488. Set ColumnFont = CapPic.Font
  489. End Property
  490.  
  491. Public Property Set ColumnFont(ByVal NewFont As StdFont)
  492. Set CapPic.Font = NewFont
  493. UserControl_Resize
  494. PropertyChanged "ColumnFont"
  495. End Property
  496. Public Property Set HeaderFont(ByVal NewFont As StdFont)
  497. Set HeadPic.Font = NewFont
  498. UserControl_Resize
  499. PropertyChanged "HeaderFont"
  500. End Property
  501. Private Sub Make3D(Obj As Object, BorderWidth As Double, Style As mBorderStyle, Optional LightColor As OLE_COLOR = &H80000016, Optional DarkColor As OLE_COLOR = &H80000010)
  502. Dim DS, DW, SM
  503. Dim K
  504. Dim x2 As Long
  505. Dim y2 As Long
  506.  
  507. Dim pixX As Integer
  508. Dim pixY As Integer
  509.  
  510. pixX = Screen.TwipsPerPixelX
  511. pixY = Screen.TwipsPerPixelY
  512.  
  513. x2 = Obj.Width - pixX
  514. y2 = Obj.Height - pixY
  515.  
  516. DS = Obj.DrawStyle
  517. DW = Obj.DrawWidth
  518. SM = Obj.ScaleMode
  519.  
  520. Obj.DrawStyle = 0
  521. Obj.DrawWidth = 1
  522. Obj.ScaleMode = vbTwips
  523.  
  524. BorderWidth = BorderWidth * 20
  525.  
  526. If BorderWidth = 0 Then
  527.    BorderWidth = 50
  528. End If
  529.  
  530. Select Case Style
  531.   Case 0    'Inset
  532.     'Upper border
  533.     For K = 0 To BorderWidth
  534.       Obj.Line (0, 0 + K)-(x2 - K, 0 + K), DarkColor
  535.     Next
  536.     
  537.     'Right border
  538.     For K = 0 To BorderWidth
  539.        Obj.Line (x2 - K, 0 + K)-(x2 - K, y2), LightColor
  540.     Next
  541.     
  542.     'Left border
  543.     For K = 0 To BorderWidth
  544.          Obj.Line (0 + K, 0)-(0 + K, y2 - K), DarkColor
  545.     Next
  546.     
  547.     'Bottom border
  548.     For K = 0 To BorderWidth
  549.       Obj.Line (0 + K, y2 - K)-(x2, y2 - K), LightColor
  550.     Next
  551.   Case 1    'Raised
  552.     'Upper border
  553.     For K = 0 To BorderWidth
  554.       Obj.Line (0, 0 + K)-(x2 - K, 0 + K), LightColor
  555.     Next
  556.     
  557.     'Right border
  558.     For K = 0 To BorderWidth
  559.        Obj.Line (x2 - K, 0 + K)-(x2 - K, y2), DarkColor
  560.     Next
  561.     
  562.     'Left border
  563.     For K = 0 To BorderWidth
  564.          Obj.Line (0 + K, 0)-(0 + K, y2 - K), LightColor
  565.     Next
  566.     
  567.     'Bottom border
  568.     For K = 0 To BorderWidth
  569.       Obj.Line (0 + K, y2 - K)-(x2, y2 - K), DarkColor
  570.     Next
  571.  
  572. End Select
  573.  
  574. Obj.DrawStyle = DS          'restore the settings
  575. Obj.DrawWidth = DW
  576. Obj.ScaleMode = SM
  577.  
  578. End Sub
  579.  
  580. Private Sub HScroll1_Change()
  581. ListPic.Left = -HScroll1.Value * 100
  582. CapPic.Left = ListPic.Left
  583. DrawColCap
  584. End Sub
  585.  
  586. Private Sub ListPic_Click()
  587. RaiseEvent Click
  588. End Sub
  589.  
  590. Private Sub ListPic_DblClick()
  591. RaiseEvent DblClick
  592. End Sub
  593.  
  594.  
  595. Private Sub ListPic_KeyDown(KeyCode As Integer, Shift As Integer)
  596. On Error Resume Next
  597. If ListPic.Enabled = True Then
  598. Select Case KeyCode
  599. Case 13
  600.     TxtEdit.Visible = False
  601.     SaveTxtEdit
  602. Case 27
  603.     TxtEdit.Visible = False
  604. Case 32
  605.     If MyMultiSelect = True Then
  606.     ItemSelected(MyListIndex) = Not ItemSelected(MyListIndex)
  607.     RefreshList
  608.     End If
  609. Case 37
  610.     If HScroll1.Value <> 0 Then HScroll1.Value = HScroll1.Value - 1
  611. Case 38
  612.     Me.ListIndex = Me.ListIndex - 1
  613. Case 39
  614.     If HScroll1.Value <> HScroll1.Max Then HScroll1.Value = HScroll1.Value + 1
  615. Case 40
  616.     If MyListIndex < ItemQty - 1 Then Me.ListIndex = Me.ListIndex + 1
  617. End Select
  618. RaiseEvent KeyDown(KeyCode, Shift)
  619. End If
  620. End Sub
  621.  
  622. Private Sub ListPic_KeyPress(KeyAscii As Integer)
  623. If ListPic.Enabled = True Then RaiseEvent KeyPress(KeyAscii)
  624. End Sub
  625.  
  626.  
  627. Private Sub ListPic_KeyUp(KeyCode As Integer, Shift As Integer)
  628. If ListPic.Enabled = True Then RaiseEvent KeyUp(KeyCode, Shift)
  629. End Sub
  630.  
  631.  
  632. Private Sub ListPic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  633. Dim yPos As Long
  634. Dim mPos As Integer
  635. Dim TxtH As Long
  636.  
  637. TxtH = ListPic.TextHeight("X")
  638. mPos = (Y - (TxtH / 2)) / TxtH
  639. yPos = mPos * TxtH
  640.  
  641. If Button = 1 And TxtEdit.Visible = False And ListPic.Enabled = True Then
  642. MyColIndex = FindCol(X)
  643. If mPos < ItemQty Then
  644. MyListIndex = mPos
  645.     If MyMultiSelect = True Then
  646.     ItemSelected(mPos) = Not ItemSelected(mPos)
  647.     End If
  648. RefreshList
  649. End If
  650. ElseIf Button = 2 And MyListIndex > -1 And MyListEdit = True Then
  651. MyColIndex = FindCol(X)
  652. TxtEdit.BackColor = ListPic.BackColor
  653. TxtEdit.ForeColor = MyTextColor
  654. TxtEdit.Visible = True
  655. TxtEdit.Height = ListPic.TextHeight("X") + 20
  656. TxtEdit.Top = MyListIndex * ListPic.TextHeight("X")
  657.     If MyColIndex = MyColCount - 1 Then
  658.         If VScroll1.Visible = False Then
  659.         TxtEdit.Width = CapPic.Width - CapSep(MyColIndex - 1).Left
  660.         Else
  661.         TxtEdit.Width = CapPic.Width - CapSep(MyColIndex - 1).Left - VScroll1.Width
  662.         End If
  663.     Else
  664.     TxtEdit.Width = Split(MyColWidth, "ª")(MyColIndex)
  665.     End If
  666.     If MyColIndex = 0 Then
  667.     TxtEdit.Left = 0
  668.     Else
  669.     TxtEdit.Left = CapSep(MyColIndex - 1).Left + 30
  670.     End If
  671. TxtEdit.Text = Split(MyItem(MyListIndex), MyColSeparator)(MyColIndex)
  672. TxtEdit.Alignment = Split(MyColListAlign, "ª")(MyColIndex)
  673. TxtEdit.SelStart = 0
  674. TxtEdit.SelLength = Len(TxtEdit.Text)
  675. TxtEdit.SetFocus
  676. End If
  677. RaiseEvent MouseDown(Button, Shift, X, Y)
  678. End Sub
  679.  
  680.  
  681. Private Sub ListPic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  682. If ListPic.Enabled = True Then RaiseEvent MouseMove(Button, Shift, X, Y)
  683. End Sub
  684.  
  685.  
  686. Private Sub ListPic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  687. If ListPic.Enabled = True Then RaiseEvent MouseUp(Button, Shift, X, Y)
  688. End Sub
  689.  
  690.  
  691. Private Sub TxtEdit_GotFocus()
  692. TxtEdit.SelStart = 0
  693. TxtEdit.SelLength = Len(TxtEdit.Text)
  694. TxtEdit.SetFocus
  695. End Sub
  696.  
  697. Private Sub TxtEdit_KeyDown(KeyCode As Integer, Shift As Integer)
  698. If KeyCode = 13 Then
  699. TxtEdit.Visible = False
  700. SaveTxtEdit
  701. ElseIf KeyCode = 27 Then
  702. TxtEdit.Visible = False
  703. End If
  704. End Sub
  705.  
  706. Private Sub UserControl_Initialize()
  707. MyListIndex = -1
  708. End Sub
  709.  
  710. Private Sub UserControl_InitProperties()
  711. MyMultiSelect = False
  712. MyScrollAuto = 2
  713. MyColSeparator = "|"
  714. MyHeadCaption = Ambient.DisplayName
  715. MyColCaption = defCaption
  716. MyColWidth = defWidth
  717. MyColCapAlign = defCapAlign
  718. MyColListAlign = defListAlign
  719. MyHeadAlign = vbCenter
  720. MyColCount = 1
  721. ListPic.Enabled = True
  722.  
  723. MyTextColor = &H80000008
  724. ListPic.BackColor = &H80000005
  725. MySelectedColor = &H8000000D
  726. SelectedTextColor = &H8000000E
  727. HeaderBackColor = &H8000000F
  728. MultiSelTextColor = vbYellow
  729. MultiNotSelTextColor = vbBlue
  730. MyListEdit = False
  731.  
  732. MyColumnBorder = SmoothRaised
  733. MyHeaderBorder = SmoothRaised
  734. MyListBorder = SmoothInsert
  735. MyControlBorder = SmoothInsert
  736.  
  737. DrawHeadCaption
  738. End Sub
  739.  
  740.  
  741. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  742. Dim Indx As Integer
  743. With PropBag
  744. ListPic.Enabled = .ReadProperty("Enabled", True)
  745. MyIntegralHeight = .ReadProperty("IntegralHeight", True)
  746. MyMultiSelect = .ReadProperty("MultiSelect", True)
  747. MyListEdit = .ReadProperty("EditableList", False)
  748. MyScrollAuto = .ReadProperty("ScrollBarAuto", 1)
  749. MyColSeparator = .ReadProperty("ColSeparator", "|")
  750. MyHeadCaption = .ReadProperty("HeaderCaption", Ambient.DisplayName)
  751. MyHeadAlign = .ReadProperty("HeaderAlignment", 2)
  752. MyColCount = .ReadProperty("ColumnCount", 1)
  753. MyColWidth = .ReadProperty("ColumnWidth", 0)
  754. MyColCaption = .ReadProperty("ColumnCaption", "")
  755. MyColCapAlign = .ReadProperty("ColCaptionAlignment", "")
  756. MyColListAlign = .ReadProperty("ColListAlignment", "")
  757.  
  758. Set BackPic.Picture = .ReadProperty("BackPicture", Nothing)
  759. MyBackPicStyle = .ReadProperty("BackPicStyle", 0)
  760.  
  761. ListPic.BackColor = .ReadProperty("BackColor", &H80000005)
  762. MyTextColor = .ReadProperty("TextColor", &H80000008)
  763. MySelectedColor = .ReadProperty("SelectedColor", &H8000000D)
  764. MySelectedTextColor = .ReadProperty("SelectedTextColor", &H8000000E)
  765. HeadPic.BackColor = .ReadProperty("HeaderBackColor", &H8000000F)
  766. HeadPic.ForeColor = .ReadProperty("HeaderForeColor", &H80000012)
  767. CapPic.BackColor = .ReadProperty("ColumnBackColor", &H8000000F)
  768. CapPic.ForeColor = .ReadProperty("ColumnForeColor", &H80000012)
  769. MyMultiSelTextColor = .ReadProperty("MultiSelTextColor", vbYellow)
  770. MyMultiNotSelTextColor = .ReadProperty("MultiNotSelTextColor", vbBlue)
  771. For I = 0 To MyColCount
  772. CapSep(I).BackColor = .ReadProperty("ColumnBackColor", &H8000000F)
  773. Next I
  774.  
  775. MyHeaderBorder = .ReadProperty("HeaderBorder", 2)
  776. MyColumnBorder = .ReadProperty("ColumnBorder", 2)
  777. MyListBorder = .ReadProperty("ListBorder", 1)
  778. MyControlBorder = .ReadProperty("ControlBorder", 1)
  779.  
  780. Set ListPic.Font = .ReadProperty("ListFont", Ambient.Font)
  781. Set HeadPic.Font = .ReadProperty("HeaderFont", Ambient.Font)
  782. Set CapPic.Font = .ReadProperty("ColumnFont", Ambient.Font)
  783. Set TxtEdit.Font = .ReadProperty("ListFont", Ambient.Font)
  784. End With
  785.  
  786. End Sub
  787.  
  788.  
  789. Private Sub UserControl_Resize()
  790. On Error Resume Next
  791. Dim TmpHeight As Long
  792. Dim TmpColW As Long
  793. Dim TotW As Long
  794. Dim Th As Long
  795. Dim K As Integer
  796.  
  797. CapSep(0).Left = PicContainer.Width
  798.  
  799. PicBorder.Left = 0
  800. PicBorder.Top = 0
  801. PicBorder.Height = UserControl.Height
  802. PicBorder.Width = UserControl.Width
  803.  
  804. PicContainer.Left = 30
  805. PicContainer.Top = 30
  806. PicContainer.Height = UserControl.Height - 60
  807. PicContainer.Width = UserControl.Width - 60
  808.  
  809. If Len(MyHeadCaption) > 0 Then
  810. HeadPic.Height = HeadPic.TextHeight("X") + 50
  811. Else
  812. HeadPic.Height = 0
  813. End If
  814. CapPic.Visible = True
  815. CapPic.Height = CapPic.TextHeight("X") + 50
  816.  
  817. MaxVQty = (PicContainer.Height - HeadPic.Height - CapPic.Height) / ListPic.TextHeight("X")
  818.  
  819. HeadPic.Top = 0
  820. HeadPic.Left = 0
  821. HeadPic.Width = PicContainer.Width ' - 10
  822. CapPic.Top = HeadPic.Height
  823. CapPic.Left = 0
  824. CapPic.Width = PicContainer.Width
  825.  
  826. For K = 0 To 19
  827. CapSep(K).Visible = False
  828. Next K
  829.  
  830. For K = 0 To MyColCount - 2
  831. CapSep(K).Top = 0
  832. CapSep(K).Height = CapPic.Height
  833. TmpColW = CLng(Split(MyColWidth, "ª")(K))
  834. TotW = TotW + TmpColW
  835. CapSep(K).Left = TotW
  836. CapSep(K).Visible = True
  837. Next K
  838. ListPic.Width = PicContainer.Width ' - 10
  839. ListPic.Top = HeadPic.Height + CapPic.Height
  840. ListPic.Left = 0
  841. DrawColCap
  842. ResizeList
  843. If Len(MyHeadCaption) > 0 Then DrawHdCap
  844. End Sub
  845.  
  846.  
  847.  
  848. Public Sub Additem(Item As String, Optional Index As Integer = -1)
  849. Dim J As Integer
  850. Dim K As Integer
  851. Dim TmpX As Long
  852. Dim TotX As Long
  853. Dim TmpY As Long
  854.  
  855. If Index = -1 Then
  856. ReDim Preserve MyItem(ItemQty + 1)
  857. ReDim Preserve ItemSelected(ItemQty + 1)
  858. MyItem(ItemQty) = Item
  859. ItemQty = ItemQty + 1
  860. Else
  861. ReDim Preserve MyItem(ItemQty + 1)
  862. ReDim Preserve ItemSelected(ItemQty + 1)
  863. For J = ItemQty + 1 To Index + 1 Step -1
  864. MyItem(J) = MyItem(J - 1)
  865.     If MyMultiSelect = True Then
  866.     ItemSelected(J) = ItemSelected(J - 1)
  867.     End If
  868. Next J
  869. MyItem(Index) = Item
  870. ItemSelected(Index) = False
  871. ItemQty = ItemQty + 1
  872. MyListIndex = Index
  873. End If
  874. HScroll1.Value = 0
  875. End Sub
  876.  
  877. Public Sub ReplaceItem(IndexToReplace As Long, NewItem As String)
  878. If IndexToReplace <> -1 Then
  879. MyItem(IndexToReplace) = NewItem
  880. MyListIndex = IndexToReplace
  881. RefreshList
  882. End If
  883. End Sub
  884.  
  885. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  886. Dim Indx As Integer
  887. With PropBag
  888. .WriteProperty "Enabled", ListPic.Enabled, True
  889. .WriteProperty "IntegralHeight", MyIntegralHeight, True
  890. .WriteProperty "MultiSelect", MyMultiSelect, True
  891. .WriteProperty "EditableList", MyListEdit, False
  892. .WriteProperty "ScrollBarAuto", MyScrollAuto, 1
  893. .WriteProperty "ColSeparator", MyColSeparator, "|"
  894. .WriteProperty "HeaderCaption", MyHeadCaption, Ambient.DisplayName
  895. .WriteProperty "HeaderAlignment", MyHeadAlign, 2
  896. .WriteProperty "ColumnCount", MyColCount, 1
  897. .WriteProperty "ColumnWidth", MyColWidth, 0
  898. .WriteProperty "ColumnCaption", MyColCaption, ""
  899. .WriteProperty "ColCaptionAlignment", MyColCapAlign, ""
  900. .WriteProperty "ColListAlignment", MyColListAlign, ""
  901.  
  902. .WriteProperty "BackPicture", BackPic.Picture, Nothing
  903. .WriteProperty "BackPicStyle", MyBackPicStyle, 0
  904.  
  905. .WriteProperty "BackColor", ListPic.BackColor, &H80000005
  906. .WriteProperty "TextColor", MyTextColor, &H80000008
  907. .WriteProperty "SelectedColor", MySelectedColor, &H8000000D
  908. .WriteProperty "SelectedTextColor", MySelectedTextColor, &H8000000E
  909. .WriteProperty "HeaderBackColor", HeadPic.BackColor, &H8000000F
  910. .WriteProperty "HeaderForeColor", HeadPic.ForeColor, &H80000012
  911. .WriteProperty "ColumnBackColor", CapPic.BackColor, &H8000000F
  912. .WriteProperty "ColumnForeColor", CapPic.ForeColor, &H80000012
  913. .WriteProperty "MultiSelTextColor", MyMultiSelTextColor, vbYellow
  914. .WriteProperty "MultiNotSelTextColor", MyMultiNotSelTextColor, vbBlue
  915. For I = 0 To MyColCount
  916. .WriteProperty "ColumnBackColor", CapSep(I).BackColor, &H8000000F
  917. Next I
  918.  
  919. .WriteProperty "HeaderBorder", MyHeaderBorder, 2
  920. .WriteProperty "ColumnBorder", MyColumnBorder, 2
  921. .WriteProperty "ListBorder", MyListBorder, 1
  922. .WriteProperty "ControlBorder", MyControlBorder, 1
  923.  
  924. .WriteProperty "ListFont", ListPic.Font, Ambient.Font
  925. .WriteProperty "HeaderFont", HeadPic.Font, Ambient.Font
  926. .WriteProperty "ColumnFont", CapPic.Font, Ambient.Font
  927. .WriteProperty "ListFont", TxtEdit.Font, Ambient.Font
  928. End With
  929.  
  930. End Sub
  931.  
  932. Private Sub VScroll1_Change()
  933. ListPic.Top = (-(VScroll1.Value * ListPic.TextHeight("X"))) + HeadPic.Height + CapPic.Height
  934. End Sub
  935.  
  936.  
  937.  
  938. Public Sub Clear()
  939. ReDim MyItem(0)
  940. ReDim ItemSelected(0)
  941. ItemQty = 0
  942. ListPic.CurrentX = 0
  943. ListPic.CurrentY = 0
  944. ListPic.Cls
  945. If HScroll1.Visible = False Then
  946. ListPic.Height = PicContainer.Height - CapPic.Height - HeadPic.Height
  947. Else
  948. ListPic.Height = PicContainer.Height - CapPic.Height - HeadPic.Height - HScroll1.Height
  949. End If
  950. ResizeList
  951. MyListIndex = -1
  952. HScroll1.Value = 0
  953. VScroll1.Value = 0
  954. TxtEdit.Text = "2"
  955. TxtEdit.Visible = False
  956. DrawColCap
  957. End Sub
  958.  
  959.  
  960. Public Property Get Selected(Index As Integer) As Boolean
  961. Attribute Selected.VB_MemberFlags = "400"
  962. Selected = ItemSelected(Index)
  963. End Property
  964.  
  965. Public Property Let Selected(Index As Integer, ByVal vNewValue As Boolean)
  966. ItemSelected(Index) = vNewValue
  967. End Property
  968.  
  969.  
  970. Public Property Get MultiSelect() As Boolean
  971. Attribute MultiSelect.VB_ProcData.VB_Invoke_Property = "General"
  972. MultiSelect = MyMultiSelect
  973. End Property
  974.  
  975. Public Property Let MultiSelect(ByVal vNewValue As Boolean)
  976. MyMultiSelect = vNewValue
  977. RefreshList
  978. End Property
  979.  
  980. Public Sub RemoveItem(Index As Integer)
  981. Dim J
  982. TxtEdit.Visible = False
  983. If Index >= 0 And Index < ItemQty Then
  984.     If Index < ItemQty - 1 Then
  985.     For J = Index To ItemQty - 1
  986.     MyItem(J) = MyItem(J + 1)
  987.     Next J
  988.     ItemQty = ItemQty - 1
  989.     ReDim Preserve MyItem(ItemQty)
  990.     ReDim Preserve ItemSelected(ItemQty)
  991.     'RefreshList
  992.     ElseIf Index = ItemQty - 1 Then
  993.     ItemQty = ItemQty - 1
  994.     ReDim Preserve MyItem(ItemQty)
  995.     ReDim Preserve ItemSelected(ItemQty)
  996.     'RefreshList
  997.     MyListIndex = -1
  998.     End If
  999. End If
  1000. End Sub
  1001.  
  1002. Private Sub ResizeList()
  1003.  
  1004. CountMaxWidth
  1005.  
  1006. Select Case MyScrollAuto
  1007. Case 0
  1008.     If TotalColWidth < PicContainer.Width Then
  1009.     HScroll1.Visible = False
  1010.     ListPic.Width = PicContainer.Width
  1011.     CapPic.Width = PicContainer.Width
  1012.         If MyIntegralHeight = False Then
  1013.         ListPic.Height = PicContainer.Height - HeadPic.Height - CapPic.Height
  1014.         Else
  1015.         ListPic.Height = MaxVQty * ListPic.TextHeight("X")
  1016.         UserControl.Height = HeadPic.Height + CapPic.Height + ListPic.Height + 60
  1017.         End If
  1018.     Else
  1019.     HScroll1.Visible = True
  1020.     ListPic.Width = TotalColWidth - 20
  1021.     CapPic.Width = TotalColWidth - 50
  1022.         If MyIntegralHeight = False Then
  1023.         ListPic.Height = PicContainer.Height - HeadPic.Height - CapPic.Height - HScroll1.Height
  1024.         Else
  1025.         ListPic.Height = (MaxVQty - 1) * ListPic.TextHeight("X")
  1026.         UserControl.Height = HeadPic.Height + CapPic.Height + ListPic.Height + HScroll1.Height + 60
  1027.         End If
  1028.     HScroll1.Left = 0
  1029.     HScroll1.Top = PicContainer.Height - HScroll1.Height
  1030.     HScroll1.Width = PicContainer.Width
  1031.     HScroll1.Max = (TotalColWidth - PicContainer.Width) / 100
  1032.     End If
  1033. Case 1
  1034.     If ItemQty > MaxVQty Then
  1035.     VScroll1.Visible = True
  1036.     ListPic.Width = PicContainer.Width - VScroll1.Width
  1037.     ListPic.Height = ItemQty * ListPic.TextHeight("X")
  1038.     VScroll1.Left = PicContainer.Width - VScroll1.Width
  1039.     VScroll1.Top = HeadPic.Height + CapPic.Height
  1040.     VScroll1.Height = PicContainer.Height - HeadPic.Height - CapPic.Height
  1041.     VScroll1.Max = (ListPic.Height - PicContainer.Height + CapPic.Height + HeadPic.Height + 60) / ListPic.TextHeight("X")
  1042.     Else
  1043.     VScroll1.Visible = False
  1044.     ListPic.Width = PicContainer.Width
  1045.     ListPic.Top = HeadPic.Height + CapPic.Height
  1046.         If MyIntegralHeight = False Then
  1047.             If ListPic.Height < (PicContainer.Height - CapPic.Height - HeadPic.Height) Then
  1048.             ListPic.Height = PicContainer.Height - CapPic.Height - HeadPic.Height
  1049.             Else
  1050.             ListPic.Height = PicContainer.Height - HeadPic.Height - CapPic.Height
  1051.             End If
  1052.         Else
  1053.         ListPic.Height = MaxVQty * ListPic.TextHeight("X")
  1054.         UserControl.Height = HeadPic.Height + CapPic.Height + ListPic.Height + 60
  1055.         End If
  1056.     End If
  1057. Case 2
  1058.     If TotalColWidth > PicContainer.Width Then
  1059.     HScroll1.Visible = True
  1060.     HScroll1.Left = 0
  1061.     HScroll1.Top = PicContainer.Height - HScroll1.Height
  1062.     HScroll1.Width = PicContainer.Width
  1063.     HScroll1.Max = (TotalColWidth - PicContainer.Width) / 100
  1064.     CapPic.Width = TotalColWidth - 50
  1065.         If ItemQty > MaxVQty Then
  1066.         VScroll1.Visible = True
  1067.         ListPic.Width = TotalColWidth - VScroll1.Width - 20
  1068.         ListPic.Height = ItemQty * ListPic.TextHeight("X")
  1069.         VScroll1.Left = PicContainer.Width - VScroll1.Width
  1070.         VScroll1.Top = HeadPic.Height + CapPic.Height
  1071.         VScroll1.Height = PicContainer.Height - HeadPic.Height - CapPic.Height - HScroll1.Height
  1072.         VScroll1.Max = (ListPic.Height - PicContainer.Height + CapPic.Height + HeadPic.Height + HScroll1.Height) / ListPic.TextHeight("X") ' + 60
  1073.         Else
  1074.         VScroll1.Visible = False
  1075.         ListPic.Width = TotalColWidth - 20
  1076.         ListPic.Top = HeadPic.Height + CapPic.Height
  1077.         If MyIntegralHeight = False Then
  1078.                 If ListPic.Height < (PicContainer.Height - CapPic.Height - HeadPic.Height) Then
  1079.                 ListPic.Height = PicContainer.Height - CapPic.Height - HeadPic.Height
  1080.                 Else
  1081.                 ListPic.Height = PicContainer.Height - HeadPic.Height - CapPic.Height
  1082.                 End If
  1083.             Else
  1084.             ListPic.Height = (MaxVQty - 1) * ListPic.TextHeight("X")
  1085.             UserControl.Height = HeadPic.Height + CapPic.Height + ListPic.Height + HScroll1.Height + 60
  1086.             End If
  1087.         End If
  1088.     Else
  1089.     HScroll1.Visible = False
  1090.     HScroll1.Top = PicContainer.Height
  1091.     ListPic.Width = PicContainer.Width
  1092.     CapPic.Width = PicContainer.Width
  1093.         If ItemQty > MaxVQty Then
  1094.         VScroll1.Visible = True
  1095.         ListPic.Height = ItemQty * ListPic.TextHeight("X")
  1096.             If ListPic.Height < (PicContainer.Height - CapPic.Height - HeadPic.Height) Then
  1097.             ListPic.Height = PicContainer.Height - CapPic.Height - HeadPic.Height
  1098.             End If
  1099.         VScroll1.Left = PicContainer.Width - VScroll1.Width
  1100.         VScroll1.Top = HeadPic.Height + CapPic.Height
  1101.         VScroll1.Height = PicContainer.Height - HeadPic.Height - CapPic.Height
  1102.         VScroll1.Max = (ListPic.Height - PicContainer.Height + CapPic.Height + HeadPic.Height) / ListPic.TextHeight("X") ' + 120
  1103.         Else
  1104.         VScroll1.Visible = False
  1105.         ListPic.Top = HeadPic.Height + CapPic.Height
  1106.             If MyIntegralHeight = False Then
  1107.                 If ListPic.Height < (PicContainer.Height - CapPic.Height - HeadPic.Height) Then
  1108.                 ListPic.Height = PicContainer.Height - CapPic.Height - HeadPic.Height
  1109.                 Else
  1110.                 ListPic.Height = PicContainer.Height - HeadPic.Height - CapPic.Height
  1111.                 End If
  1112.             Else
  1113.             ListPic.Height = MaxVQty * ListPic.TextHeight("X")
  1114.             UserControl.Height = HeadPic.Height + CapPic.Height + ListPic.Height + 60
  1115.             End If
  1116.         End If
  1117.         If VScroll1.Visible = True Then
  1118.         ListPic.Width = PicContainer.Width - VScroll1.Width
  1119.         Else
  1120.         ListPic.Width = PicContainer.Width
  1121.         End If
  1122.     End If
  1123.     If ListPic.Height < (PicContainer.Height - CapPic.Height - HeadPic.Height) Then
  1124.     ListPic.Height = PicContainer.Height - CapPic.Height - HeadPic.Height
  1125.     End If
  1126. End Select
  1127. RefreshList
  1128. End Sub
  1129.  
  1130. Public Property Get ListCount() As Long
  1131. ListCount = ItemQty
  1132. End Property
  1133.  
  1134.  
  1135. Public Property Get ListIndex() As Long
  1136. Attribute ListIndex.VB_MemberFlags = "400"
  1137. ListIndex = MyListIndex
  1138. End Property
  1139.  
  1140. Public Property Let ListIndex(ByVal vNewValue As Long)
  1141. If vNewValue > -1 And vNewValue < ItemQty Then
  1142. MyListIndex = vNewValue
  1143. End If
  1144. If HScroll1.Visible = True Then
  1145.     If MyListIndex > MaxVQty - 3 And MyListIndex < ItemQty Then
  1146.     VScroll1.Value = MyListIndex - MaxVQty + 2
  1147.     End If
  1148. Else
  1149.     If MyListIndex > MaxVQty - 2 And MyListIndex < ItemQty Then
  1150.     VScroll1.Value = MyListIndex - MaxVQty + 1
  1151.     End If
  1152. End If
  1153. RefreshList
  1154. End Property
  1155.  
  1156. Public Property Get ScrollBarAuto() As mScrollAuto
  1157. ScrollBarAuto = MyScrollAuto
  1158. End Property
  1159.  
  1160. Public Property Let ScrollBarAuto(ByVal vNewValue As mScrollAuto)
  1161. MyScrollAuto = vNewValue
  1162. PropertyChanged "ScrollBarAuto"
  1163. End Property
  1164.  
  1165. Public Property Get ColSeparator() As String
  1166. Attribute ColSeparator.VB_ProcData.VB_Invoke_Property = "General"
  1167. ColSeparator = MyColSeparator
  1168. End Property
  1169.  
  1170. Public Property Let ColSeparator(ByVal vNewValue As String)
  1171. MyColSeparator = vNewValue
  1172. PropertyChanged "ColSeparator"
  1173. End Property
  1174.  
  1175. Public Property Get HeaderCaption() As String
  1176. Attribute HeaderCaption.VB_ProcData.VB_Invoke_Property = "General"
  1177. HeaderCaption = MyHeadCaption
  1178. End Property
  1179.  
  1180. Public Property Let HeaderCaption(ByVal vNewValue As String)
  1181. MyHeadCaption = vNewValue
  1182. DrawHeadCaption
  1183. PropertyChanged "HeaderCaption"
  1184. End Property
  1185.  
  1186. Public Property Get HeaderAlignment() As AlignmentConstants
  1187. HeaderAlignment = MyHeadAlign
  1188. End Property
  1189.  
  1190. Public Property Let HeaderAlignment(ByVal vNewValue As AlignmentConstants)
  1191. MyHeadAlign = vNewValue
  1192. DrawHeadCaption
  1193. PropertyChanged "HeaderAlignment"
  1194. End Property
  1195.  
  1196. Private Sub DrawHeadCaption()
  1197. DrawHdCap
  1198. UserControl_Resize
  1199.  
  1200. End Sub
  1201.  
  1202. Private Sub DrawHdCap()
  1203. HeadPic.CurrentX = 0
  1204. HeadPic.CurrentY = 0
  1205. HeadPic.Cls
  1206.  
  1207. DrawBorder
  1208. If Len(MyHeadCaption) > 0 Then
  1209. Select Case MyHeadAlign
  1210. Case 0
  1211. HeadPic.CurrentX = 50
  1212. HeadPic.CurrentY = (HeadPic.Height - HeadPic.TextHeight("X")) / 2
  1213. HeadPic.Print MyHeadCaption
  1214. Case 1
  1215. HeadPic.CurrentX = HeadPic.Width - HeadPic.TextWidth(MyHeadCaption) - 50
  1216. HeadPic.CurrentY = (HeadPic.Height - HeadPic.TextHeight("X")) / 2
  1217. HeadPic.Print MyHeadCaption
  1218. Case 2
  1219. HeadPic.CurrentX = (HeadPic.Width - HeadPic.TextWidth(MyHeadCaption)) / 2
  1220. HeadPic.CurrentY = (HeadPic.Height - HeadPic.TextHeight("X")) / 2
  1221. HeadPic.Print MyHeadCaption
  1222. End Select
  1223. End If
  1224. End Sub
  1225.  
  1226. Private Sub DrawColCap()
  1227. Dim TmpCap As String
  1228. Dim TmpAlign As Integer
  1229.  
  1230. CapPic.CurrentX = 0
  1231. CapPic.CurrentY = 0
  1232. CapPic.Cls
  1233.  
  1234. DrawBorder
  1235. For I = 0 To MyColCount - 1
  1236. TmpAlign = Int(Split(MyColCapAlign, "ª")(I))
  1237. TmpCap = Split(MyColCaption, "ª")(I)
  1238. Select Case TmpAlign
  1239. Case 0
  1240.     If I = 0 Then
  1241.     CapPic.CurrentX = 30
  1242.     Else
  1243.     CapPic.CurrentX = CapSep(I - 1).Left + 60
  1244.     End If
  1245. Case 1
  1246.     If I = 0 Then
  1247.     CapPic.CurrentX = (CapSep(I).Left - CapPic.TextWidth(TmpCap)) - 60
  1248.     ElseIf I = MyColCount - 1 Then
  1249.     CapPic.CurrentX = CapPic.Width - CapPic.TextWidth(TmpCap) - 60
  1250.     Else
  1251.     CapPic.CurrentX = CapSep(I).Left - CapPic.TextWidth(TmpCap) - 60
  1252.     End If
  1253. Case 2
  1254.     If I = 0 Then
  1255.     CapPic.CurrentX = (CapSep(I).Left - CapPic.TextWidth(TmpCap)) / 2
  1256.     ElseIf I = MyColCount - 1 Then
  1257.     CapPic.CurrentX = (CapPic.Width - CapPic.TextWidth(TmpCap) + CapSep(I - 1).Left) / 2
  1258.     Else
  1259.     CapPic.CurrentX = (CapSep(I).Left - CapPic.TextWidth(TmpCap) + CapSep(I - 1).Left) / 2
  1260.     End If
  1261. End Select
  1262.  
  1263. CapPic.CurrentY = (CapPic.Height - CapPic.TextHeight("X")) / 2
  1264. CapPic.Print TmpCap
  1265. Next I
  1266.  
  1267. End Sub
  1268. Public Property Get ColumnWidth(Index As Integer) As Long
  1269. Attribute ColumnWidth.VB_MemberFlags = "400"
  1270. ColumnWidth = CLng(Split(MyColWidth, "ª")(Index))
  1271. End Property
  1272.  
  1273. Public Property Let ColumnWidth(Index As Integer, ByVal vNewValue As Long)
  1274. SetColWidth Index, vNewValue
  1275. UserControl_Resize
  1276. PropertyChanged "ColumnWidth"
  1277. End Property
  1278.  
  1279. Public Property Get ColumnCaption(Index As Integer) As String
  1280. Attribute ColumnCaption.VB_ProcData.VB_Invoke_Property = "Column"
  1281. ColumnCaption = Split(MyColCaption, "ª")(Index)
  1282. End Property
  1283.  
  1284. Public Property Let ColumnCaption(Index As Integer, ByVal vNewValue As String)
  1285. SetColCaption Index, vNewValue
  1286. UserControl_Resize
  1287. PropertyChanged "ColumnCaption"
  1288. End Property
  1289.  
  1290. Public Property Get ColumnCount() As Integer
  1291. Attribute ColumnCount.VB_ProcData.VB_Invoke_Property = "Column"
  1292. ColumnCount = MyColCount
  1293. End Property
  1294.  
  1295. Public Property Let ColumnCount(ByVal vNewValue As Integer)
  1296. If vNewValue > 20 Then
  1297. MsgBox "This ListBox is limited to 20 columns"
  1298. Else
  1299. MyColCount = vNewValue
  1300. UserControl_Resize
  1301. End If
  1302.  
  1303. PropertyChanged "ColumnCount"
  1304. End Property
  1305.  
  1306. Private Sub SetColCaption(Index As Integer, mCaption As String)
  1307. On Error Resume Next
  1308. Dim OldCap(19) As String
  1309. For I = 0 To 19
  1310. OldCap(I) = Split(MyColCaption, "ª")(I)
  1311. Next I
  1312. OldCap(Index) = mCaption
  1313. MyColCaption = ""
  1314. For I = 0 To 19
  1315. MyColCaption = MyColCaption & OldCap(I) & "ª"
  1316. Next I
  1317.  
  1318. SetColWidPic.Print MyHeadCaption
  1319. CEnd Property
  1320.  
  1321. Public Property Get ColumnCounsnd Property
  1322.  
  1323. Public Property Get ColumnCounsnd fContainer.Width
  1324.     HScrolyrt MyHeadCaption
  1325. End Select
  1326. End If
  1327. End Sub
  1328.  
  1329.     HScrolyrt MyHeadCaption
  1330. End Select
  1331. End If
  1332. End Sub
  1333.  
  1334.     HScrolyrt MyHeadCaption
  1335. End Select
  1336. End If
  1337. End Sub
  1338.  
  1339.     HSct(MyColCaptionBgnment(ByVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaC6False
  1340.   aaaSelect
  1341. End If(dit.Ttberty
  1342.  
  1343. Public Property Let ListIndex(ByVal vNewValue As Long)
  1344. If vNewValue > feDim Preserveon(Index As Integer) Aht f Oaaaaaaaaaa"
  1345. End  aaa= Aht f Oaaaaaaaaaa"
  1346. End  aaa= Aht tGaaaaaaa"&&y "ListBorder", MyListBorder, 1
  1347. .WriteProperty "ControlBorder", MyControlBorder, 1
  1348.  
  1349. .WriteProperty "ListFont", ListPic.Font, Ambient.Font
  1350. .Wr(l1.w"aaaaaaa" aaa= Aht f Oaaaagx aaaaa"&&y "ListBorder", MyListBorder, 1
  1351. .WriteProp "ListBorder", MyListBorder, 1
  1352. .WriteProperty "ControlBorder", MyControlBorder, 1
  1353.  
  1354. .WriteProperty "ListFont", LisHeight = MaxVQty * ListPic.TextHeighaaaaaaaaaaaaae
  1355. UserContro"aaaaaaa" aaa=  = False
  1356. Next, MyControlBorder, 1ControlBorder, 1ControlBorderler, 1
  1357.  
  1358.       =   &H8000000F&
  1359.             Heightnt",9
  1360. OldCap(I) = Spl"H800000
  1361. OldCaprder", MyListBorder, 1
  1362. .WriteProp "ListBorder", MyLis        End If
  1363.         End If
  1364.         If VScroll1.Visible = True Then
  1365.         ListPic.Width = PicContainer.Width - VScr.TextHeight("X")
  1366.             End If
  1367.         If VScroll1.>2 "2"
  1368. TxtEdit.Vi0b DrawHdCap    HScroln
  1369. End Select
  1370. End If
  1371. End Sub
  1372.  
  1373.     HScrjth K
  1374. Publi2 = &H8000ic.CEaaaaaOldCap(Iubli2 =1 HScroln
  1375. E0l Then
  1376.     CapPic.CurrentX = (CapSep(I).Left - Cap")
  1377.           ptiap")
  1378.           ptiap")
  1379.           pt    Certy("ListFonaaaaaaaaaaaaaaaaaListFonaaa  ptiap")
  1380.           pt )X2H   pt   A   ndex - 1).Left
  1381.         
  1382.           pt  p")
  1383.        KsolBorder  ndex - 1).Lefue As AThen
  1384.     CapPic.CurrentX = CapPic.Width - CapPic.TextWidth(TmpCap) - 60
  1385.     Else
  1386.     CapPic.CurtX = ListIndex(ByVal vNewValue A"U)       CurtX = LitX = CapsolBorderye
  1387. Next, U)       CurtX = LitX = CapsRaptioontainer.Width
  1388.     HScroll1.Mtainer.Widtoll1.Mtainer.Widtoll1.Mtainer.Widtoll1o = 0
  1389. HeadPic.7n       CurtX = LitX =L= 1kdCaption) - 50
  1390. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaint MyHeadgn, "ª"yListBorder, 1
  1391. .Writeaaaaaaaaa-ypCap) - 60
  1392.     Else
  1393.     CapPic.CeGaaaaaaaaaaa"yListBorder, 1
  1394. .WriteapPic.Width - CapPic.TextWidth(TmpCap1
  1395. .WriteapPic.W0 r.Widtoll1o = 0
  1396. HeadPic.iteaaaaaaaaaMyListBorderlc.CurX = LitX =L= 1kdCapo = 0
  1397. HHHHHHHHHnorderye
  1398. NeLaption
  1399. CasePic.iteaaam - 60
  1400.  a
  1401. End IWriteapPic. LitX   Visible         =   0   'FEnd If  ptiap")
  1402.           ptiap")
  1403.            .Width - CapPic.T         ptiap") K = 0 To BordJ
  1404. Case 38
  1405. riteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Heigoperty Get ColumnCounsnd fContaineand fCong)
  1406. If vNewVaaaaaaaaaaaaaaaaaaDc.TextWidth(TmpCap1
  1407. .WriteapPic.W0 Ull1.Height = 
  1408. If vNewVVaaaaaaaaaaaaaaa= iteaing)
  1409. On Error Resume Next
  1410. Dim OldCap(19, "ty("HeaderBor, W, SM
  1411. Dim K
  1412. D8eapPic.W0 Ull1.Height = 
  1413. If vNewVVaaaaaaaaaaaan.VB_ProcData.H.VB_Procdth(TmpCap1
  1414. .WriteapPic.W0 r.Wight = PicCoeight = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = it- 1
  1415. TmpAight = iteall1.Height = iteall1.Height1.Hy Get ColumnCount() As Integer
  1416. Attribaaaaaaint MyHeVtiap") K = 0 To BordJ
  1417. Case 38
  1418. riteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Heightall180 iteall1.Height = iteall1.Heigse
  1419.     Cap0nalue = 0
  1420. Txt-rPic.CurrentX = CapSepsible   iteall1.Height = iteall1.yHeVtiaght = iteall1.Height = iteall1.He-g(tiaght = TextW7lHe-g(tiagnght = iteaalize()
  1421. MyListIRBordJ
  1422. Case 38
  1423.  
  1424. MyLixtW7lH,esc_ = iteaalizeeB_ProcData.H.VB_P         Width           =   1545
  1425.  Ot = eight = itealtealtealtealtealtealtealt 1545
  1426.  Ot = ee Altealtealtea = 0
  1427. HHHHHHH   Width           =   1545
  1428.  Ot = eightpiteall1.Height = altt = itealtealtealteal2perty
  1429.  
  1430. Pri7lH,esc45
  1431.  Heightkrty
  1432.  
  1433. Pri7lH,ttealtealteal2perty
  1434.  
  1435. Pri7lH,esc
  1436. Dim OldCa2pPic.Width - C"
  1437. End Property
  1438.  
  1439. Public Property Get ColumnCaption(I1.Height = apertyaineand fCong)
  1440. If6d fContaineaE = 0
  1441. Cntainer.Height -PHeighp (tiagdlit(MyColCap)= 
  1442. If vNewVVaaaaaaiagdlit(Myarator"
  1443. End Pighterty
  1444.  
  1445.  
  1446. Public Propertyaaaaaaaaaaaaaaaaaaa_PubliH,esc
  1447. Dim OldCa2pPic.Width - C"
  1448. End Property
  1449.  
  1450. Public Property Get ColLeft =ubliH,,esc
  1451. Dim _nd fCraaaaaaaaaaa_PubliH,epPic.W0 r.dJ
  1452. Case 38
  1453. riteall1.H)"
  1454. Et =ubliH,,.Height1.Hy Get ColumnI,,.Height1.Hy Get ColumnI)"6ealaa_PubliH,epPic.W0 r.dJ
  1455. Case 38
  1456. eight = it- 1
  1457. TmpAight =,,5.W0 r.Widtoll1o = 0
  1458. HeadPic.iteaaaaaaaaaMyListBorderlc.CurX = LitX =L= 1kdCapo = 0
  1459. HHHHHHHHHnoX = LitX =L= mighp (tie.Writ4List.Hy Get ColumnI)"6eal= mighp8i_&r)
  1460. PlumnI)"6
  1461. End Select
  1462. Endie.WistFont", Ambie,Pic.W0 r.dJ
  1463. Case 38
  1464.  
  1465. 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
  1466.     ', BordeString
  1467. Dit4List.Hy Get ColumnI)"6eal= mighp8i_&r)ll1.HeigdeString
  1468. Dit4List.Hy
  1469. End Select
  1470. EndieeeeeeeeeeeeeeeeWLt1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Height = iteall1.Heigoperty Get ColumnCounsnd fContaineand fCong)
  1471. If vNewVaaaaaaaaaaaaaaaaaaDc.TextWidth(TmpCap1
  1472. .WriteapPic.W0 Ull1.Het ColumnCounsnd c.CurrentX = CapeFI = &H8000ic.CEaaaaaOldCap(Iubli2 =1 HScroln
  1473. E0l Then
  1474.     CapPic.CurrentX = (CapSep(I).Left - Capigoperty Get ColumnCl1.Height = iaaaaalteaI).Left - Ca("X"iht = itrty("ListFoCase 38aaaaaaall1.H)"
  1475. Et =ubliH,,.Hei.Height = iteall1.Heiger)
  1476. PubliIaaaaaaaaaaaaaaaDc.TextGet Columall1.Heiger)
  1477. PubliIaaaaaaaaaaaaaaaDc.Texte c.CurrentX = Certyaaaaaaaaae
  1478. tau
  1479. Private 1 HScro_ture = .btiaght = iger)
  1480. all f Oaaaaaaaaaa"
  1481. End  aaa= Aht L
  1482. PubliIaaaaaaaaaae
  1483. 2o
  1484.   aaaSel(MyColCapt_ aaaSel(MyCoaaall1.H)"
  1485. Et =ubliH,,.Hei.HeiColumnI)"6eal=2ghtpPic.Pr,,.Hei.HeiCol38aaaaaaaiª
  1486. 2o
  1487.   aaaSel(MyColCapt_ aaaSel(MyCoaaall1.H)"
  1488. Et =ubliH,,.Hei.H&l1.H)caontrol.Height = HeadPic.Height + CapPic.Height + ListPic.Height x
  1489.  Ot = eightpitea + ightpitea + ightpitea +  )
  1490.         UserCont.Left - Cbli2 =1 HScroln
  1491. ontainer.Width
  1492.     HScroll1.Mtainer.Wids
  1493. ontainer.Width
  1494.     HScroll1.Mtainer.Wids
  1495. ontainpsible = True
  1496. gse
  1497.   ty
  1498.  
  1499. Pri7lH,esc45
  1500.  Heightkrty
  1501.  
  1502. Pri7lH
  1503.  
  1504. Pri7lH
  1505.  
  1506. Pri
  1507. Dim OldCa2pPic.Width - C"
  1508. End Property
  1509. Sep(I).Le.Height1.Hy Get ColumnI,,.Height1.Hy Get ColumnI)"6ealaa_PubliH,epPic.W0 r.dJ
  1510. CaseadAlign = vNnidth =
  1511. .WriteProp "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLSbliH,epPicong)
  1512. If vNewVaaaaaaaaaaaaaaaaaaDc.TextWid = iteall1.Heiger)
  1513. PubliIaaaaaaaaaa- Cbli2 =1 HScroln
  1514. ontaCa2pPic.Width - C"
  1515. End Property
  1516. Sep(I).Le.Height1.Hy Get ColumnI,,.Height1.Hy Get ColumnI)"6ealaa_PubliH,epPic.W0 r.dJ
  1517. CaseGpPic.Widt6m, "ty("HeaderBor, W, SM
  1518. D1.Height = iteall1.Heigoperty Get Colu
  1519. End  aaaht = iteall1.Heig-=W6olu
  1520. tainer.Width
  1521.     HScroll1.Mtainer.Wids
  1522. ontainpsibeen.TwdCapWids
  1523. otdddddddddddddditeall1.Width - C"
  1524. Enw)dL-t_" eallI0ic.W0 r.dJ
  1525. CaseGpPic.Widt6m, aaaaaaaaaaaaaaaaaaaaaael(MyColCapt_ aaaSel(MyCoaaall1.H)"
  1526. Et =ubliH,,.He4aaaaaaaaaaaaaaael(MyCyL-t_" eallI0ic.W0 r.dJ-t_" eallI0ic.W0 r.dJion
  1527. MyColCap= itealtealtealteal2perty
  1528.  
  1529. Pri7lH,esc45
  1530.  Heightkrty
  1531.  
  1532. Pri7lH,ttealtealteal2perty
  1533.  
  1534. Pri7lH,esc
  1535. Dim OldCa2pPic.Width - C"
  1536. End Property
  1537.  
  1538. Public Property Get ColumnCaption(I1.Height = apertyaineand fCong)
  1539. If6d fContaineaE = 0
  1540. Cntainer.Height -PHeighp ( fContaineanvan(I1.HeI,J-t_" eallIdth - C"
  1541. End Property
  1542. End Property
  1543.  
  1544. Public Property Get ColumnCaption(I1.HiW(ropet_ aaaSeontaiGet Colfol.Height = e= PicConmlHyGen tic.CurrentX = (CapSepaaaaaael(MyColCapt_Height
  1545.    entX = (Capaaaaaaaaaaaaaaaaaaael(MyCol+.He
  1546. Del(Mynd Property_" eall+.He
  1547. Del(Mynd PropertyFnth = PicCont+aaaPicCont+aaaPicContaaPicContaaPCont+aaaPont=f
  1548. R
  1549.         Liviont= As AThen
  1550.     CapP
  1551. If6d fConlumnI + CapPic.Height + ListPic.Height x
  1552.  Ot = eightpitea + ightpitea + ightpitea +  )
  1553.         UserCont.Left - Cbli2 =1 HScroln
  1554. ontainer.Width
  1555.     HScroll1.Mtainer.Wids
  1556. ontainer.Width
  1557.     HScroll1.Mtainer.Wids
  1558. ontainpsible = True
  1559. gse
  1560.   ty
  1561.  
  1562. Pri7lH,esc45
  1563. tainL7operty Ghtkrty
  1564.  
  1565. Pri7lH
  1566.  
  1567. Pri7lH
  1568.  
  1569. Pri
  1570. Dim OldCa2pPic.Width - C"
  1571. End Property
  1572. Sep(I).Le.Hner.Wids
  1573. ontainpsible = True
  1574. _Height
  1575.    umnCaption(I1.HiW(ropet_ aaaSeontaiGet Colfol.Height = e= PicConmlHyGen tic.CurrentX = (CapSepaaaaaael(MyColCapt_Height
  1576. paaaaaael(MyColCapt_H" eallI0ic.W0 r.Het ColumnCounsnd c.del(MyColCapt_Huto
  1577. Case 0
  1578.     If TotalColWidth < PicCaption.VB_PrEnpsible =hIf I = MyGet ColumnI)"
  1579. Ifble =hIf I = MyGet ColumnI)"
  1580. Ifble =hIf I = MyGet Columtion(I1.HiW(ro2
  1581. .WritePropeea + igColumtion.Hiu
  1582. Private 1 aption(I1.Hey
  1583.  
  1584. Pri7lH
  1585.  
  1586. Pion.Hiu
  1587. Privropeea + igColumtion.HiSJ-t_" eallIdth - C"
  1588. End P Columtion(I1.HemQty = ItemQty + 1
  1589. 0HiW(ro2
  1590. .WritFn(I1.HemQty = ItemQty + 1
  1591. 0HiW(ro2
  1592. .WritFn(IalteaI).nd P Cight = iteS0True
  1593. _Height
  1594.    um1oMmQty + 1
  1595. 0HiW(ro2
  1596. .eiW(ro2
  1597. .eiW(roion(I1.Hey
  1598.  
  1599. Prilumtion(I1.Ht Colfol.Height = e= PicConmlHyGen tic.CurrentXiderCaption(ByS+ igColumtion.HiSJ-t_" eallIdth - C"
  1600. End P ColuSelect
  1601. End If
  1602. End AAAAAAAAAAHeightkrty. iteall1.Height = iteall1.Height = iteall14 AAAHeition.Hix04).nd P Cig)derl8
  1603. eight = it- 1
  1604. TmpAight =,,5.W0 r.Wi"eight = iteall14 AAAHeition.TsRaptioontainer.Width
  1605.     HScroll1.Mtainer.Widtolpeea + DHP Cig)derl = iteall14 AAAHeition.Hix04).nd P Cigoect = vNewValuiAX = (Capaaaaaaaaaaaaaa04).ty + 1Bl1.Height  )    
  1606.           d P Columtion(I1.HemQty =6
  1607.     nIeiner.Widttaineanvan(I1.HeI,J-t_" eallIdth - C"
  1608. End PropertyistPic.Width = PicCoeI,J-t_" ea0D
  1609. .WritePropWidth = PicCoeI,J-t_" .Width
  1610. .Widttaineanvan(I1.HeI,J-t_" eallIdth ªanvan(I1.ttaeallIdth ªanvan(I1.ttaeallIdth ªanvan(I1.ttdth ªanvanatdth ªanvanatd
  1611. HHHHHHHHHnoX = LitX =L= mighp (tie.Writ4List.Hy GetJ-t_" .Width
  1612. .WidttI1.HemQty d=ight - HeadPict_H" eallI0ic.W0 r.Het ColumnCounsnd c.delst.vanatd
  1613. HHHHc.delst.vanatd
  1614. HHHHc.delst.vanatd
  1615. glIdth ªandelst.vanatd
  1616. glIdth ªandelst.vanatd
  1617. gt.vanatd
  1618. glIdC)))))adPicyY)))adPicyY)))adPicynd If
  1619. "I1.tadPicyY)))adPicyY)))adPicynd If
  1620. "I1.dth - PicContainer.ic.delst.vro2
  1621. all1.Heigption(ByS+ i lst.at.vanat.Hei.HeiCol38aaaaaaaiªDWids    End If
  1622. End Seleol38aaaaaaaiªDWids    van(I
  1623. TmpAightnd Seleol38aaaaaaaiªDWiol38aaaaaaaiªDWids    E(I
  1624. Teol38aaaaaaaiªDWiol38aa lst.at.vanat.Hei.Heeol38aaaaaaaiªDWiols*ol38aiue
  1625. UserControl_RtemQty)
  1626.    h ªandelst.vanatd
  1627. gt.vanatdtisxVQty + 1
  1628.     End Ifa + DHP Cig)derl = iteall14 AAAHeit
  1629. UserControl_Rtr.Hei)) / 2(aaaaaaaaaaaaag)derl = btNewValue > 20 Then
  1630. MsgBox "This Listelst.vanatd
  1631. glIdth - Ca("X"iht = itrty(aªDWd
  1632. glIdC)))))eerl = btNewValue > 20 Then
  1633. 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
  1634. End Seleol38aaaaaaa= btNewValue > ue > ue > c.Heigs4)) / 2icContainer.ic.Hy GeHHHHHHluee > ueBeadPict_H"  c.Heigs4)) /)lst.vanatd
  1635. HHHHc.donmlHyGen tic.CurrentX = (CapSewValue > ue p(I).Le.Hnean(Iue > ue p(I).    ptiap") K = 0 To BordJ
  1636. CasF)iap") K = 0 Tntainer.1 Ca("X"iht = i8 > 20 Then
  1637. Ms  c.Heigs4)) /)lst2)
  1638. MyCoT1.dell14 AAAHeitionoltealte.Et =ubliH,,.Hei.H&l1.sp(I).Le.Hnean(Iue H,,.Hei3l14 AAAHeition) /)lst2)
  1639. Miner.1 Ca(ion) /)lsll14 A
  1640.    h ªandelst.vanatd
  1641. gt.nSHHHHHlue > l)   End If
  1642.         If VScroll1.>2 "2"
  1643. TxtEl)   End If
  1644.    If
  1645.     leol38aaaaaaa= btNewValue > ue > uee3n5 e -ue > ue p(I).    ptiap")WL
  1646. .Writ)   Endo .nalaa_lyHeadgn, "ª"yListBoreigs4)) /"eigs4))t C h ªandelst.vanatd
  1647. gt.nSHHHHHlue > l)   En ell1M7th(TmpCHHHHue prH(( i8 > 20 Then
  1648. Ms  c.Heigs4))Yd fConlumnI + CapPic.Height +c.Cls
  1649.  
  1650. DrawBordenatd
  1651. gt2Pt.nSHHHHHlue > l)  eight - CapPic.Height) /Kight - CapPic.Heighll144))Align = .ReListBor NewValue > ue > uee3n5 e -ue > ue p(I).    ptiap")WL
  1652. .Writ)   Endo .nalaa_lyH-btNewValue > ue > (ion) /)lsl = .ReListBor = iteall14 AAAHeition.Tst.vami)lsl = .ReListrrentX = (CapSewValue > ue p(I).Le.Hnean(IW ue > (ion) /)lsl = .ReListBor l3rty
  1653. S4atd
  1654. gt.nSHHHHHlue > l) 1it Case TmpAlign
  1655. Case 0
  1656.     If I = 0 Then
  1657.     CapPin(Iue H,,.Hei3l14 AAAHeei)) / 2t l3rty
  1658. S4atd
  1659. gt.nSHHHHHlue > ll3rty
  1660. S4att.Hiign
  1661. Croll1.Mtai CapJcap(I) = Spl"H8000-btNewcap(I) = Sp(Iue H ll3 = itealt.nSHHHHHlue > ll3rty
  1662. S4att.Hiign
  1663. Croll1.Mtai C= Soll1.Mtai CapJcap(I) = + ightpitea + ightpitelign
  1664. Caseo .nlst2"tv iigre / 2(aaaaal3rty
  1665. S4atd
  1666. gt.nSHHHHHlue > aaaaaaaaaaaaalg + ightpitea + ightpitelignrh
  1667. .Widttaineanvan(taineaEg)
  1668. If vNewVaaaaaaaaaaaaaaaaaast.at.vanat.Hei.Heeol38aaaaaaaiªDWiols*o   If aaaaaaaaadttaineanvan(taineaEg)
  1669. If vNewVaaaaa8aaaaal(Mygt.nSHHHHHlue > l(tainit)   Endo .nalaa_lyH-bmKaaaaaalg + ightpitea + ightpitelignrh
  1670. .Widttaineanvan aaaaaaaaaaaaaaaaaaavan aaaaaaaaaaaaaaaaaaavan aaaaaaaaaaaaaaaaaaavan aaaaaaaaaaaaaaaaaaavan aaaaaaaaaaaaaaaaaaavan aaaaaaaaaaaaaaaaaaavan aaaaaaaaaaaaaaaaaaavan aaaaaaaaaaaaaaaa h ªandelst.vanatd
  1671. gl1M7th(TmpCHHHHue prHght -
  1672.  
  1673. D aaaaaaaaaaaeiªDWids    E(I
  1674. Teol38aaaanataaaaaaaaeiªDWiHue prHght -
  1675.  
  1676. D aaaaaaaaaaaeiªDWids    Eght -
  1677.  
  1678. Dty + 1
  1679.     End 6glIdC)MsgBox "This Listelst.vanatd
  1680. glIdth - Ca("X"iht = itrty(aªDWd
  1681. glIdC)))))eerl = btNewValij5th = song)
  1682. If vNewValue > = song)
  1683. If v OldCap(I) & "ª"
  1684. Next I
  1685. .TextHeight("X")ong)
  1686. If v OldCap(I) &s= song)
  1687. If v OldCap(I) & "ª"
  1688. Next f v OldCap(I) & "ª"
  1689. N,J-t_" eepSewValueit Case TmpAlepSewValueit CasyColCapt_Height
  1690. paaaaaael(MyColCapt_H" eallI0ic.W0 r.Het ColumnCounsnd c.del(MyColCapt_Huto
  1691. Case 0
  1692.     If TotalColWidth < PineanvanHHHHH.l(MyColCapt_H" eao2
  1693. all1.Heigption(ByS+ i lst.at.vanat.Hei.HeaaaaiªDWiCase 0
  1694.     If TotalCol1_H" eao2
  1695. all1.Heiel(MyColC
  1696. gt.nSHHHHHlue > l)   Ea
  1697. l0
  1698.     If TotalCol1_HX I = 0 To 1l)   Ea
  1699. l0
  1700.       If1l1_H" eao2tY = (CapP v OldCapurrentX = 0
  1701. CapPic.CurrentY = 0
  1702. CapPic.Clso Then
  1703. MsgBox "This Listelst.vanatd
  1704. glIdth - Ca("X"iht = itrty(aªDWd
  1705. glIdC)))))eerl = btNewValue > 20 Then
  1706. MsgBox "ThColCapt_H" eao2
  1707. all1.C
  1708. gt.nSHHHHHlupt_H" eao2
  1709. all1.C
  1710. gt.nSHHHHHl0derl8
  1711. eigh_H" eao2
  1712. all1.Heiel(MyColC
  1713. gt.nSHHHHHlue > l)   Ea
  1714. l0
  1715.     If TotalCol1_HX I = 0 To 1l)   Ea
  1716. l0
  1717.       If1l1_H" eao2tY = (CapP v OldCapurrentX = 0
  1718. CapPic.Curren)1HHHHlue > l)  l)  (t.nSHHHHHl0derl8ng)
  1719. If v OldCap(I)a
  1720. l0)))lieall+.He
  1721. Daption &&&&&&&&&&&&&m  If
  1722.     leol38aaaaaaa= btNewValue > ue > uee3n5 e -ue > ue p(I).    ptiap")WL
  1723. .Writ)   Endo .   Ea
  1724. l0
  1725.  R")WL
  1726. .Writ)   Endo .   Ea
  1727. l0
  1728.  R")WL
  1729. .Writ)   Ene
  1730.     HScroll1.Visible = False
  1731.     HScroll1.Top = PicConer
  1732. Attriberl = btNewValue > 20 Then
  1733. MsgB6f aaaaaaaa AAAHeition.TD5Ceall14 AAAHeition.Hix04).nd P Cigoect = vNewValuiAX = (Capaaaaaaaaaaaaaa04).ty + 1Bl1.Height  )    
  1734.           d P Columtion(I1.Hn
  1735. CapPic.Clso ect = vNewValy + 1Bl1.Height  )    
  1736.           d P Columtio 
  1737.        lsoCBl1.tt       d P 0apPig)
  1738. lSub
  1739.  
  1740.  
  1741. Private Sub ht = iteall14 AAAHeil)   End If
  1742. berl = btNewV
  1743. ontaiBl1.tt       d P 0apPigl = btNewiBl1.Bl1.Bl1.Bl1.Bl1.Bl