home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / vbasic / Data / Utils / cmdbtnx5.msi / Cabs.w1.cab / DropDown.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-08-01  |  9.2 KB  |  285 lines

  1. VERSION 5.00
  2. Object = "{20976770-692B-4564-84B5-CCC822AA2B7A}#1.2#0"; "CmdBtnX5.ocx"
  3. Begin VB.Form frmDropDown 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "DropDown Demonstration"
  6.    ClientHeight    =   5685
  7.    ClientLeft      =   1950
  8.    ClientTop       =   1545
  9.    ClientWidth     =   6450
  10.    BeginProperty Font 
  11.       Name            =   "Tahoma"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "DropDown.frx":0000
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   379
  24.    ScaleMode       =   3  'Pixel
  25.    ScaleWidth      =   430
  26.    ShowInTaskbar   =   0   'False
  27.    StartUpPosition =   2  'CenterScreen
  28.    Begin VB.CommandButton cmdPicture 
  29.       Caption         =   "&Default"
  30.       Height          =   330
  31.       Index           =   1
  32.       Left            =   2610
  33.       TabIndex        =   8
  34.       Tag             =   "Clears the DropDownPicture property, reverting it to the default down arrow."
  35.       Top             =   2745
  36.       Width           =   1140
  37.    End
  38.    Begin VB.CommandButton cmdPicture 
  39.       Caption         =   "Change..."
  40.       Height          =   330
  41.       Index           =   0
  42.       Left            =   1395
  43.       TabIndex        =   7
  44.       Tag             =   "Browses for a new picture file to replay the current image with"
  45.       Top             =   2745
  46.       Width           =   1140
  47.    End
  48.    Begin CommandButtonXDemo.pucEventList evlDrop 
  49.       Height          =   1365
  50.       Left            =   135
  51.       TabIndex        =   10
  52.       Top             =   4140
  53.       Width           =   6180
  54.       _ExtentX        =   10901
  55.       _ExtentY        =   2408
  56.       ExitVisible     =   -1  'True
  57.    End
  58.    Begin VB.Timer tmrUpdateTip 
  59.       Interval        =   250
  60.       Left            =   3555
  61.       Top             =   1710
  62.    End
  63.    Begin VB.TextBox txtSize 
  64.       Height          =   285
  65.       Left            =   135
  66.       TabIndex        =   5
  67.       Tag             =   "Allows you to change the size of the drop down button partition"
  68.       Top             =   2745
  69.       Width           =   1050
  70.    End
  71.    Begin VB.ComboBox cboDropDownStyle 
  72.       Height          =   315
  73.       ItemData        =   "DropDown.frx":014A
  74.       Left            =   1890
  75.       List            =   "DropDown.frx":0154
  76.       Style           =   2  'Dropdown List
  77.       TabIndex        =   3
  78.       Tag             =   "Allows you to change the drop down mode. Normal splits the button into two further buttons, where NoSeperator keeps one button."
  79.       Top             =   2070
  80.       Width           =   1860
  81.    End
  82.    Begin VB.ComboBox cboBorderStyle 
  83.       Height          =   315
  84.       ItemData        =   "DropDown.frx":017B
  85.       Left            =   135
  86.       List            =   "DropDown.frx":018E
  87.       Style           =   2  'Dropdown List
  88.       TabIndex        =   1
  89.       Tag             =   $"DropDown.frx":01D6
  90.       Top             =   2070
  91.       Width           =   1590
  92.    End
  93.    Begin CommandButtonXCtl.CommandButtonX cmdxDemo 
  94.       Height          =   1275
  95.       Left            =   4005
  96.       TabIndex        =   9
  97.       Tag             =   "CommandButtonX features a DropDownClick event, allowing popup menus to be automatically displayed if required."
  98.       Top             =   1800
  99.       Width           =   2310
  100.       _ExtentX        =   4075
  101.       _ExtentY        =   2249
  102.       DropDownPicture =   "DropDown.frx":0275
  103.       Caption         =   "Demo DropDown"
  104.       Style           =   3
  105.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  106.          Name            =   "Tahoma"
  107.          Size            =   8.25
  108.          Charset         =   0
  109.          Weight          =   400
  110.          Underline       =   0   'False
  111.          Italic          =   0   'False
  112.          Strikethrough   =   0   'False
  113.       EndProperty
  114.    End
  115.    Begin CommandButtonXDemo.pucTextTip pucSimpleTip1 
  116.       Height          =   735
  117.       Left            =   135
  118.       Top             =   900
  119.       Width           =   6180
  120.       _ExtentX        =   10901
  121.       _ExtentY        =   1296
  122.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  123.          Name            =   "Tahoma"
  124.          Size            =   8.25
  125.          Charset         =   0
  126.          Weight          =   400
  127.          Underline       =   0   'False
  128.          Italic          =   0   'False
  129.          Strikethrough   =   0   'False
  130.       EndProperty
  131.       Text            =   $"DropDown.frx":02F7
  132.    End
  133.    Begin CommandButtonXDemo.pucTextTip tipDesc 
  134.       Height          =   780
  135.       Left            =   135
  136.       Top             =   3240
  137.       Width           =   6180
  138.       _ExtentX        =   10901
  139.       _ExtentY        =   1376
  140.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  141.          Name            =   "Tahoma"
  142.          Size            =   8.25
  143.          Charset         =   0
  144.          Weight          =   400
  145.          Underline       =   0   'False
  146.          Italic          =   0   'False
  147.          Strikethrough   =   0   'False
  148.       EndProperty
  149.       Text            =   "Colors Demonstration"
  150.    End
  151.    Begin VB.Label lblHdr 
  152.       AutoSize        =   -1  'True
  153.       Caption         =   "DropDownPicture:"
  154.       Height          =   195
  155.       Index           =   3
  156.       Left            =   1395
  157.       TabIndex        =   6
  158.       Top             =   2520
  159.       Width           =   1305
  160.    End
  161.    Begin VB.Label lblHdr 
  162.       AutoSize        =   -1  'True
  163.       Caption         =   "DropDownSize:"
  164.       Height          =   195
  165.       Index           =   2
  166.       Left            =   135
  167.       TabIndex        =   4
  168.       Top             =   2520
  169.       Width           =   1095
  170.    End
  171.    Begin VB.Label lblHdr 
  172.       AutoSize        =   -1  'True
  173.       Caption         =   "DropDownStyle:"
  174.       Height          =   195
  175.       Index           =   0
  176.       Left            =   1890
  177.       TabIndex        =   2
  178.       Top             =   1845
  179.       Width           =   1170
  180.    End
  181.    Begin VB.Label lblHdr 
  182.       AutoSize        =   -1  'True
  183.       Caption         =   "BorderStyle:"
  184.       Height          =   195
  185.       Index           =   1
  186.       Left            =   135
  187.       TabIndex        =   0
  188.       Top             =   1845
  189.       Width           =   900
  190.    End
  191.    Begin CommandButtonXDemo.pucLogoPane LogoPane1 
  192.       Align           =   1  'Align Top
  193.       Height          =   780
  194.       Left            =   0
  195.       Top             =   0
  196.       Width           =   6450
  197.       _ExtentX        =   11377
  198.       _ExtentY        =   1376
  199.       Picture         =   "DropDown.frx":0382
  200.    End
  201.    Begin VB.Menu mnuPopup 
  202.       Caption         =   "{POPUP}"
  203.       Visible         =   0   'False
  204.       Begin VB.Menu mnuPopupItem 
  205.          Caption         =   "Item &1"
  206.          Index           =   0
  207.       End
  208.    End
  209. Attribute VB_Name = "frmDropDown"
  210. Attribute VB_GlobalNameSpace = False
  211. Attribute VB_Creatable = False
  212. Attribute VB_PredeclaredId = True
  213. Attribute VB_Exposed = False
  214. Option Explicit
  215. DefInt A-Z
  216. Private Sub cboBorderStyle_Click()
  217.  cmdxDemo.BorderStyle = cboBorderStyle.ListIndex
  218. End Sub
  219. Private Sub cboDropDownStyle_Click()
  220.  cmdxDemo.DropDownStyle = cboDropDownStyle.ListIndex
  221. End Sub
  222. Private Sub cmdPicture_Click(Index As Integer)
  223.  Dim File$
  224.  Select Case Index
  225.   Case 0
  226.    File$ = SelectFile$(hWnd, "Pictures (*.bmp;*.dib;*.ico;*.gif;*.jpg;*.rle;*.wmf)|*.bmp;*.dib;*.gif;*.ico;*.jpg;*.rle;*.wmf|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Icons (*.ico)|*.ico|Windows Metafiles (*.wmf)|*.wmf|Internet Images (*.gif;*.jpg)|*.gif;*.jpg", "bmp", , "Browse Picture")
  227.    If Len(File$) Then
  228.     On Error Resume Next
  229.      Set cmdxDemo.DropDownPicture = LoadPicture(File$)
  230.      If Err Then
  231.       MsgBox Error$
  232.      End If
  233.     On Error GoTo 0
  234.    End If
  235.   Case 1
  236.    'setting the DropDownPicture to Nothing
  237.    'reverts to the default arrow
  238.    Set cmdxDemo.DropDownPicture = Nothing
  239.  End Select
  240. End Sub
  241. Private Sub cmdxDemo_Click()
  242.  evlDrop.Add "Click"
  243. End Sub
  244. Private Sub cmdxDemo_DropDownClick(MenuData As Object)
  245.  evlDrop.Add "DropDownClick"
  246.  Set MenuData = mnuPopup
  247. End Sub
  248. Private Sub evlDrop_ExitClicked()
  249.  Unload Me
  250. End Sub
  251. Private Sub Form_Load()
  252.  Dim I
  253.  tmrUpdateTip_Timer
  254.  With cmdxDemo
  255.   cboBorderStyle.ListIndex = .BorderStyle
  256.   cboDropDownStyle.ListIndex = .DropDownStyle
  257.   txtSize = .DropDownSize
  258.  End With
  259.  'add some sample menus
  260.  For I = 1 To 8
  261.   Load mnuPopupItem(I)
  262.   mnuPopupItem(I).Caption = "Item &" & (I - 1)
  263.  Next
  264. End Sub
  265. Private Sub tmrUpdateTip_Timer()
  266.  Static hWndCtl As Long
  267.  Dim Tmp As Long
  268.  Dim Act As Control
  269.  On Error Resume Next
  270.   Set Act = ActiveControl
  271.   If Act Is Nothing Then
  272.    tipDesc.Text = ""
  273.   Else
  274.    Tmp = Act.hWnd
  275.    If Err = 0 And Tmp <> hWndCtl Then
  276.     hWndCtl = Tmp
  277.     tipDesc.Text = Act.Tag
  278.    End If
  279.   End If
  280.  On Error GoTo 0
  281. End Sub
  282. Private Sub txtSize_Change()
  283.  cmdxDemo.DropDownSize = Val(txtSize)
  284. End Sub
  285.