home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / mlist460.zip / ITMHITE.FRM < prev    next >
Text File  |  1995-09-04  |  7KB  |  249 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "ItemHeight Demo"
  4.    ClientHeight    =   2670
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1755
  7.    ClientWidth     =   6750
  8.    Height          =   3360
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2670
  12.    ScaleWidth      =   6750
  13.    Top             =   1125
  14.    Width           =   6870
  15.    Begin CommandButton cmdReload 
  16.       Caption         =   "Reload MList"
  17.       Height          =   312
  18.       Left            =   4080
  19.       TabIndex        =   8
  20.       Top             =   1800
  21.       Width           =   2415
  22.    End
  23.    Begin CommandButton cmdAddItems 
  24.       Caption         =   "Add Items"
  25.       Height          =   312
  26.       Left            =   4080
  27.       TabIndex        =   7
  28.       Top             =   1440
  29.       Width           =   2415
  30.    End
  31.    Begin CommandButton cmdSetHeight 
  32.       Caption         =   "Set Height"
  33.       Height          =   312
  34.       Left            =   5280
  35.       TabIndex        =   6
  36.       Top             =   960
  37.       Width           =   1215
  38.    End
  39.    Begin CommandButton cmdSetSize 
  40.       Caption         =   "Set Size"
  41.       Height          =   312
  42.       Left            =   5280
  43.       TabIndex        =   5
  44.       Top             =   480
  45.       Width           =   1215
  46.    End
  47.    Begin TextBox txtItemHeight 
  48.       Height          =   285
  49.       Left            =   4080
  50.       TabIndex        =   4
  51.       Text            =   "txtItemHeight"
  52.       Top             =   960
  53.       Width           =   855
  54.    End
  55.    Begin TextBox txtFontSize 
  56.       Height          =   285
  57.       Left            =   4080
  58.       TabIndex        =   2
  59.       Text            =   "txtFontSize"
  60.       Top             =   480
  61.       Width           =   855
  62.    End
  63.    Begin MListBox MList1 
  64.       AddItemHeight   =   0
  65.       Alignment       =   0  'None
  66.       AllowFocusRect  =   -1  'True
  67.       AutoCheck       =   -1  'True
  68.       BorderStyle     =   0  'Normal
  69.       CheckColor      =   &H00000000&
  70.       CheckStyle      =   0  'Cross Style
  71.       DrawRegions     =   0
  72.       EnableVirtualMsgs=   0   'False
  73.       ExtendedSelect  =   0   'False
  74.       FallColor       =   &H00808080&
  75.       FindDirection   =   0  'Forward
  76.       FindResult      =   0  'Update ListIndex
  77.       GridColor       =   &H00808080&
  78.       GridStyle       =   0  'Solid
  79.       Height          =   1395
  80.       HiliteBackColor =   &H00000000&
  81.       HiliteForeColor =   &H00000000&
  82.       HorizontalGrids =   -1  'True
  83.       ImageRegion     =   0
  84.       ImageType       =   0  'None
  85.       ItemHeight      =   195
  86.       ItemWidth       =   1560
  87.       Left            =   600
  88.       ListBoxStyle    =   1  'Variable
  89.       MaskingColor    =   &H00FFFFFF&
  90.       MultiColumn     =   0   'False
  91.       MultiSelect     =   0   'False
  92.       NoIntegralHeight=   0   'False
  93.       OwnerCompare    =   0   'False
  94.       OwnerDraw       =   0   'False
  95.       Partner         =   0
  96.       RiseColor       =   &H00FFFFFF&
  97.       SearchCompare   =   1  'Case Insensitive
  98.       SelectMode      =   0  'Normal
  99.       SortColumn      =   0
  100.       Sorted          =   0   'False
  101.       SortOrder       =   0  'Ascending
  102.       SortType        =   0  'String
  103.       StringCompare   =   0  'Case Sensitive
  104.       TabIndex        =   0
  105.       Top             =   360
  106.       Version         =   "04.60"
  107.       VerticalGrids   =   0   'False
  108.       VirtualMsgZone  =   0
  109.       Width           =   2055
  110.    End
  111.    Begin Label lblItemHeight 
  112.       AutoSize        =   -1  'True
  113.       Caption         =   "ItemHeight is:"
  114.       Height          =   195
  115.       Left            =   600
  116.       TabIndex        =   9
  117.       Top             =   2040
  118.       Visible         =   0   'False
  119.       Width           =   1185
  120.    End
  121.    Begin Label Label2 
  122.       Caption         =   "ItemHeight:"
  123.       Height          =   195
  124.       Left            =   2880
  125.       TabIndex        =   3
  126.       Top             =   960
  127.       Width           =   1095
  128.    End
  129.    Begin Label Label1 
  130.       Caption         =   "FontSize:"
  131.       Height          =   195
  132.       Left            =   2880
  133.       TabIndex        =   1
  134.       Top             =   480
  135.       Width           =   855
  136.    End
  137.    Begin Menu mnuOptions 
  138.       Caption         =   "&Options"
  139.       Begin Menu mnuOSkipReload 
  140.          Caption         =   "&Skip Reload"
  141.          Checked         =   -1  'True
  142.       End
  143.       Begin Menu mnuOSep3 
  144.          Caption         =   "-"
  145.       End
  146.       Begin Menu mnuOShowLabelControl 
  147.          Caption         =   "&Show Label Control"
  148.       End
  149.       Begin Menu mnuOSep2 
  150.          Caption         =   "-"
  151.       End
  152.       Begin Menu mnuOExit 
  153.          Caption         =   "E&xit"
  154.       End
  155.    End
  156. End
  157. Option Explicit
  158.  
  159. Dim msItem() As String
  160.  
  161. Sub cmdAddItems_Click ()
  162.     Dim i As Integer
  163.  
  164.     For i = Mlist1.ListCount + 1 To Mlist1.ListCount + 10
  165.         Mlist1.AddItem "Item" & Format$(i, "000")
  166.     Next
  167.  
  168. End Sub
  169.  
  170. Sub cmdReload_Click ()
  171.  
  172.     Call MListItemsResize(Mlist1, lblItemHeight.Height)
  173.  
  174. End Sub
  175.  
  176. Sub cmdSetHeight_Click ()
  177.  
  178.     Mlist1.AddItemHeight = txtItemHeight
  179.     lblItemHeight = txtItemHeight
  180.     If mnuOSkipReload.Checked Then
  181.         Mlist1.ItemHeight = txtItemHeight
  182.     Else
  183.         Call MListItemsResize(Mlist1, txtItemHeight)
  184.     End If
  185.  
  186. End Sub
  187.  
  188. Sub cmdSetSize_Click ()
  189.     
  190.     ' turn off redraw until all changes are complete
  191.     Mlist1.DisableDrawing = True
  192.  
  193.     Mlist1.FontSize = txtFontSize
  194.     lblItemHeight.FontSize = Mlist1.FontSize
  195.  
  196.     'lblItemHeight's AutoSize property is true, and we use
  197.     ' this to get the new item height for the MList, since
  198.     ' they both are using the same font and fontsize.
  199.     lblItemHeight = lblItemHeight.Height
  200.     txtItemHeight = lblItemHeight.Height
  201.     If mnuOSkipReload.Checked Then
  202.         Mlist1.AddItemHeight = lblItemHeight.Height
  203.     Else
  204.         Call MListItemsResize(Mlist1, lblItemHeight.Height)
  205.     End If
  206.  
  207.     ' we're done, so redraw the control
  208.     Mlist1.DisableDrawing = False
  209.  
  210. End Sub
  211.  
  212. Sub Form_Load ()
  213.  
  214.  
  215.     Dim i As Integer
  216.     For i = 1 To 20
  217.         Mlist1.AddItem "Item" & Format$(i, "000")
  218.     Next
  219.  
  220.     txtFontSize = Mlist1.FontSize
  221.     txtItemHeight = Mlist1.ItemHeight
  222.     lblItemHeight = lblItemHeight.Height
  223.  
  224. End Sub
  225.  
  226. Sub mnuOExit_Click ()
  227.  
  228.     Unload Me
  229.  
  230. End Sub
  231.  
  232. Sub mnuOShowLabelControl_Click ()
  233.  
  234.     mnuOShowLabelControl.Checked = Not mnuOShowLabelControl.Checked
  235.     If mnuOShowLabelControl.Checked Then
  236.         lblItemHeight.Visible = True
  237.     Else
  238.         lblItemHeight.Visible = False
  239.     End If
  240.  
  241. End Sub
  242.  
  243. Sub mnuOSkipReload_Click ()
  244.  
  245.     mnuOSkipReload.Checked = Not mnuOSkipReload.Checked
  246.     
  247. End Sub
  248.  
  249.