home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / ucComboTra1945531132005.psc / fTest.frm < prev    next >
Text File  |  2005-10-30  |  10KB  |  352 lines

  1. VERSION 5.00
  2. Begin VB.Form fTest 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Demo"
  5.    ClientHeight    =   5250
  6.    ClientLeft      =   45
  7.    ClientTop       =   465
  8.    ClientWidth     =   7095
  9.    BeginProperty Font 
  10.       Name            =   "Tahoma"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H00000000&
  19.    LinkTopic       =   "Form1"
  20.    MaxButton       =   0   'False
  21.    ScaleHeight     =   350
  22.    ScaleMode       =   3  'Pixel
  23.    ScaleWidth      =   473
  24.    StartUpPosition =   2  'CenterScreen
  25.    Begin VB.ComboBox cbTrackbarPosition 
  26.       BeginProperty Font 
  27.          Name            =   "Tahoma"
  28.          Size            =   9
  29.          Charset         =   0
  30.          Weight          =   400
  31.          Underline       =   0   'False
  32.          Italic          =   0   'False
  33.          Strikethrough   =   0   'False
  34.       EndProperty
  35.       Height          =   330
  36.       Left            =   345
  37.       Style           =   2  'Dropdown List
  38.       TabIndex        =   7
  39.       Top             =   3615
  40.       Width           =   1815
  41.    End
  42.    Begin VB.CheckBox chkLocked 
  43.       Caption         =   "Locked"
  44.       BeginProperty Font 
  45.          Name            =   "Tahoma"
  46.          Size            =   9
  47.          Charset         =   0
  48.          Weight          =   400
  49.          Underline       =   0   'False
  50.          Italic          =   0   'False
  51.          Strikethrough   =   0   'False
  52.       EndProperty
  53.       Height          =   270
  54.       Left            =   360
  55.       TabIndex        =   9
  56.       Top             =   4425
  57.       Width           =   1170
  58.    End
  59.    Begin VB.ComboBox cbBackStyle 
  60.       BeginProperty Font 
  61.          Name            =   "Tahoma"
  62.          Size            =   9
  63.          Charset         =   0
  64.          Weight          =   400
  65.          Underline       =   0   'False
  66.          Italic          =   0   'False
  67.          Strikethrough   =   0   'False
  68.       EndProperty
  69.       Height          =   330
  70.       Left            =   360
  71.       Style           =   2  'Dropdown List
  72.       TabIndex        =   3
  73.       Top             =   2325
  74.       Width           =   1815
  75.    End
  76.    Begin VB.ComboBox cbStyle 
  77.       BeginProperty Font 
  78.          Name            =   "Tahoma"
  79.          Size            =   9
  80.          Charset         =   0
  81.          Weight          =   400
  82.          Underline       =   0   'False
  83.          Italic          =   0   'False
  84.          Strikethrough   =   0   'False
  85.       EndProperty
  86.       Height          =   330
  87.       Left            =   360
  88.       Style           =   2  'Dropdown List
  89.       TabIndex        =   5
  90.       Top             =   2970
  91.       Width           =   1815
  92.    End
  93.    Begin VB.ListBox lstEvents 
  94.       Appearance      =   0  'Flat
  95.       BeginProperty Font 
  96.          Name            =   "Tahoma"
  97.          Size            =   9
  98.          Charset         =   0
  99.          Weight          =   400
  100.          Underline       =   0   'False
  101.          Italic          =   0   'False
  102.          Strikethrough   =   0   'False
  103.       EndProperty
  104.       Height          =   3390
  105.       Left            =   2880
  106.       TabIndex        =   10
  107.       TabStop         =   0   'False
  108.       Top             =   1260
  109.       Width           =   3855
  110.    End
  111.    Begin Test.ucComboTrackbar ucComboTrackbar1 
  112.       Height          =   330
  113.       Left            =   360
  114.       TabIndex        =   1
  115.       Top             =   1260
  116.       Width           =   1815
  117.       _ExtentX        =   3201
  118.       _ExtentY        =   582
  119.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  120.          Name            =   "Tahoma"
  121.          Size            =   9
  122.          Charset         =   0
  123.          Weight          =   700
  124.          Underline       =   0   'False
  125.          Italic          =   0   'False
  126.          Strikethrough   =   0   'False
  127.       EndProperty
  128.       RangeMax        =   1
  129.       RangeMin        =   -1
  130.       RangePrecision  =   1
  131.       Style           =   3
  132.    End
  133.    Begin VB.CheckBox chkEnabled 
  134.       Caption         =   "Enabled"
  135.       BeginProperty Font 
  136.          Name            =   "Tahoma"
  137.          Size            =   9
  138.          Charset         =   0
  139.          Weight          =   400
  140.          Underline       =   0   'False
  141.          Italic          =   0   'False
  142.          Strikethrough   =   0   'False
  143.       EndProperty
  144.       Height          =   270
  145.       Left            =   360
  146.       TabIndex        =   8
  147.       Top             =   4080
  148.       Value           =   1  'Checked
  149.       Width           =   1170
  150.    End
  151.    Begin VB.Label lblTrackbarPosition 
  152.       Caption         =   "TrackbarPosition:"
  153.       BeginProperty Font 
  154.          Name            =   "Tahoma"
  155.          Size            =   9
  156.          Charset         =   0
  157.          Weight          =   400
  158.          Underline       =   0   'False
  159.          Italic          =   0   'False
  160.          Strikethrough   =   0   'False
  161.       EndProperty
  162.       Height          =   270
  163.       Left            =   360
  164.       TabIndex        =   6
  165.       Top             =   3390
  166.       Width           =   1365
  167.    End
  168.    Begin VB.Label lblBackStyle 
  169.       Caption         =   "BackStyle:"
  170.       BeginProperty Font 
  171.          Name            =   "Tahoma"
  172.          Size            =   9
  173.          Charset         =   0
  174.          Weight          =   400
  175.          Underline       =   0   'False
  176.          Italic          =   0   'False
  177.          Strikethrough   =   0   'False
  178.       EndProperty
  179.       Height          =   270
  180.       Left            =   375
  181.       TabIndex        =   2
  182.       Top             =   2100
  183.       Width           =   1425
  184.    End
  185.    Begin VB.Label lblStyle 
  186.       Caption         =   "Style:"
  187.       BeginProperty Font 
  188.          Name            =   "Tahoma"
  189.          Size            =   9
  190.          Charset         =   0
  191.          Weight          =   400
  192.          Underline       =   0   'False
  193.          Italic          =   0   'False
  194.          Strikethrough   =   0   'False
  195.       EndProperty
  196.       Height          =   270
  197.       Left            =   375
  198.       TabIndex        =   4
  199.       Top             =   2745
  200.       Width           =   1365
  201.    End
  202.    Begin VB.Label lblSample 
  203.       Caption         =   "Sample:"
  204.       BeginProperty Font 
  205.          Name            =   "Tahoma"
  206.          Size            =   9
  207.          Charset         =   0
  208.          Weight          =   400
  209.          Underline       =   0   'False
  210.          Italic          =   0   'False
  211.          Strikethrough   =   0   'False
  212.       EndProperty
  213.       Height          =   270
  214.       Left            =   375
  215.       TabIndex        =   0
  216.       Top             =   1005
  217.       Width           =   1320
  218.    End
  219. End
  220. Attribute VB_Name = "fTest"
  221. Attribute VB_GlobalNameSpace = False
  222. Attribute VB_Creatable = False
  223. Attribute VB_PredeclaredId = True
  224. Attribute VB_Exposed = False
  225. Option Explicit
  226.  
  227. Private m_lEventCount As Long
  228.  
  229. Private Sub Form_Load()
  230.     
  231.     With cbBackStyle
  232.         .AddItem "0 - [bsSolidColor]"
  233.         .AddItem "1 - [bsImage]"
  234.         .ListIndex = 0
  235.     End With
  236.     
  237.     With cbStyle
  238.         .AddItem "0 - [sClassic]"
  239.         .AddItem "1 - [sFlat]"
  240.         .AddItem "2 - [sFlatMono]"
  241.         .AddItem "3 - [sThemed]"
  242.         .ListIndex = 0
  243.     End With
  244.     
  245.     With cbTrackbarPosition
  246.         .AddItem "0 - [tpWide]"
  247.         .AddItem "1 - [tpCentered]"
  248.         .ListIndex = 0
  249.     End With
  250.     
  251.     Set ucComboTrackbar1.BackImage = LoadResPicture(101, vbResBitmap)
  252.     Let ucComboTrackbar1.Text = Format$(0, ucComboTrackbar1.PrecisionFormat)
  253. End Sub
  254.  
  255. Private Sub Form_Paint()
  256.     
  257.     Me.Line (0, 0)-(Me.ScaleWidth, 50), vbWhite, BF
  258.     
  259.     Me.CurrentX = 10
  260.     Me.CurrentY = 8
  261.     Me.Font.Size = 12
  262.     Me.Font.Bold = True
  263.     Me.Print "ucComboTrackbar simple demo"
  264.     
  265.     Me.CurrentX = 10
  266.     Me.CurrentY = 30
  267.     Me.Font.Size = 9
  268.     Me.Font.Bold = False
  269.     Me.Print "Not all properties are shown"
  270. End Sub
  271.  
  272. Private Sub Form_Unload(Cancel As Integer)
  273.     Call mCCEx.SafeEnd
  274. End Sub
  275.  
  276. '//
  277.  
  278. Private Sub cbBackStyle_Click()
  279.     ucComboTrackbar1.BackStyle = cbBackStyle.ListIndex
  280. End Sub
  281.  
  282. Private Sub cbStyle_Click()
  283.     ucComboTrackbar1.Style = cbStyle.ListIndex
  284. End Sub
  285.  
  286. Private Sub cbTrackbarPosition_Click()
  287.     ucComboTrackbar1.TrackbarPosition = cbTrackbarPosition.ListIndex
  288. End Sub
  289.  
  290. Private Sub chkEnabled_Click()
  291.     ucComboTrackbar1.Enabled = CBool(chkEnabled)
  292. End Sub
  293.  
  294. Private Sub chkLocked_Click()
  295.     ucComboTrackbar1.Locked = CBool(chkLocked)
  296. End Sub
  297.  
  298. '//
  299.  
  300. Private Sub ucComboTrackbar1_Change()
  301.     Call pvAddEventString("Change [Value = " & ucComboTrackbar1.Value & "]")
  302. End Sub
  303.  
  304. Private Sub ucComboTrackbar1_Scroll()
  305.     Call pvAddEventString("Scroll")
  306. End Sub
  307.  
  308. Private Sub ucComboTrackbar1_GotFocus()
  309.     Call pvAddEventString("GotFocus")
  310. End Sub
  311.  
  312. Private Sub ucComboTrackbar1_LostFocus()
  313.     Call pvAddEventString("LostFocus")
  314. End Sub
  315.  
  316. 'Private Sub ucComboTrackbar1_KeyDown(KeyCode As Integer, Shift As Integer)
  317. '    Call pvAddEventString("KeyDown (KeyCode: " & KeyCode & " Shift: " & Shift & ")")
  318. 'End Sub
  319. '
  320. 'Private Sub ucComboTrackbar1_KeyPress(KeyAscii As Integer)
  321. '    Call pvAddEventString("KeyPress (KeyAscii: " & KeyAscii & ")")
  322. 'End Sub
  323. '
  324. 'Private Sub ucComboTrackbar1_KeyUp(KeyCode As Integer, Shift As Integer)
  325. '    Call pvAddEventString("KeyUp (KeyCode: " & KeyCode & " Shift: " & Shift & ")")
  326. 'End Sub
  327.  
  328. Private Sub ucComboTrackbar1_ThemeChanged()
  329.     Call pvAddEventString("ThemeChanged")
  330. End Sub
  331.  
  332. Private Sub ucComboTrackbar1_TrackbarShow()
  333.     Call pvAddEventString("TrackbarShow")
  334. End Sub
  335.  
  336. Private Sub ucComboTrackbar1_TrackbarHide()
  337.     Call pvAddEventString("TrackbarHide")
  338. End Sub
  339.  
  340. Private Sub pvAddEventString(ByVal sString As String)
  341.     
  342.     With lstEvents
  343.         m_lEventCount = m_lEventCount + 1
  344.         
  345.         If (.ListCount = 16) Then
  346.             Call .RemoveItem(0)
  347.         End If
  348.         Call .AddItem(Format$(m_lEventCount, "00000 ") & sString)
  349.         .ListIndex = .ListCount - 1
  350.     End With
  351. End Sub
  352.