home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{20976770-692B-4564-84B5-CCC822AA2B7A}#1.2#0"; "CmdBtnX5.ocx"
- Begin VB.Form frmDropDown
- BorderStyle = 3 'Fixed Dialog
- Caption = "DropDown Demonstration"
- ClientHeight = 5685
- ClientLeft = 1950
- ClientTop = 1545
- ClientWidth = 6450
- BeginProperty Font
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Icon = "DropDown.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 379
- ScaleMode = 3 'Pixel
- ScaleWidth = 430
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton cmdPicture
- Caption = "&Default"
- Height = 330
- Index = 1
- Left = 2610
- TabIndex = 8
- Tag = "Clears the DropDownPicture property, reverting it to the default down arrow."
- Top = 2745
- Width = 1140
- End
- Begin VB.CommandButton cmdPicture
- Caption = "Change..."
- Height = 330
- Index = 0
- Left = 1395
- TabIndex = 7
- Tag = "Browses for a new picture file to replay the current image with"
- Top = 2745
- Width = 1140
- End
- Begin CommandButtonXDemo.pucEventList evlDrop
- Height = 1365
- Left = 135
- TabIndex = 10
- Top = 4140
- Width = 6180
- _ExtentX = 10901
- _ExtentY = 2408
- ExitVisible = -1 'True
- End
- Begin VB.Timer tmrUpdateTip
- Interval = 250
- Left = 3555
- Top = 1710
- End
- Begin VB.TextBox txtSize
- Height = 285
- Left = 135
- TabIndex = 5
- Tag = "Allows you to change the size of the drop down button partition"
- Top = 2745
- Width = 1050
- End
- Begin VB.ComboBox cboDropDownStyle
- Height = 315
- ItemData = "DropDown.frx":014A
- Left = 1890
- List = "DropDown.frx":0154
- Style = 2 'Dropdown List
- TabIndex = 3
- Tag = "Allows you to change the drop down mode. Normal splits the button into two further buttons, where NoSeperator keeps one button."
- Top = 2070
- Width = 1860
- End
- Begin VB.ComboBox cboBorderStyle
- Height = 315
- ItemData = "DropDown.frx":017B
- Left = 135
- List = "DropDown.frx":018E
- Style = 2 'Dropdown List
- TabIndex = 1
- Tag = $"DropDown.frx":01D6
- Top = 2070
- Width = 1590
- End
- Begin CommandButtonXCtl.CommandButtonX cmdxDemo
- Height = 1275
- Left = 4005
- TabIndex = 9
- Tag = "CommandButtonX features a DropDownClick event, allowing popup menus to be automatically displayed if required."
- Top = 1800
- Width = 2310
- _ExtentX = 4075
- _ExtentY = 2249
- DropDownPicture = "DropDown.frx":0275
- Caption = "Demo DropDown"
- Style = 3
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin CommandButtonXDemo.pucTextTip pucSimpleTip1
- Height = 735
- Left = 135
- Top = 900
- Width = 6180
- _ExtentX = 10901
- _ExtentY = 1296
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Text = $"DropDown.frx":02F7
- End
- Begin CommandButtonXDemo.pucTextTip tipDesc
- Height = 780
- Left = 135
- Top = 3240
- Width = 6180
- _ExtentX = 10901
- _ExtentY = 1376
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Text = "Colors Demonstration"
- End
- Begin VB.Label lblHdr
- AutoSize = -1 'True
- Caption = "DropDownPicture:"
- Height = 195
- Index = 3
- Left = 1395
- TabIndex = 6
- Top = 2520
- Width = 1305
- End
- Begin VB.Label lblHdr
- AutoSize = -1 'True
- Caption = "DropDownSize:"
- Height = 195
- Index = 2
- Left = 135
- TabIndex = 4
- Top = 2520
- Width = 1095
- End
- Begin VB.Label lblHdr
- AutoSize = -1 'True
- Caption = "DropDownStyle:"
- Height = 195
- Index = 0
- Left = 1890
- TabIndex = 2
- Top = 1845
- Width = 1170
- End
- Begin VB.Label lblHdr
- AutoSize = -1 'True
- Caption = "BorderStyle:"
- Height = 195
- Index = 1
- Left = 135
- TabIndex = 0
- Top = 1845
- Width = 900
- End
- Begin CommandButtonXDemo.pucLogoPane LogoPane1
- Align = 1 'Align Top
- Height = 780
- Left = 0
- Top = 0
- Width = 6450
- _ExtentX = 11377
- _ExtentY = 1376
- Picture = "DropDown.frx":0382
- End
- Begin VB.Menu mnuPopup
- Caption = "{POPUP}"
- Visible = 0 'False
- Begin VB.Menu mnuPopupItem
- Caption = "Item &1"
- Index = 0
- End
- End
- Attribute VB_Name = "frmDropDown"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- DefInt A-Z
- Private Sub cboBorderStyle_Click()
- cmdxDemo.BorderStyle = cboBorderStyle.ListIndex
- End Sub
- Private Sub cboDropDownStyle_Click()
- cmdxDemo.DropDownStyle = cboDropDownStyle.ListIndex
- End Sub
- Private Sub cmdPicture_Click(Index As Integer)
- Dim File$
- Select Case Index
- Case 0
- 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")
- If Len(File$) Then
- On Error Resume Next
- Set cmdxDemo.DropDownPicture = LoadPicture(File$)
- If Err Then
- MsgBox Error$
- End If
- On Error GoTo 0
- End If
- Case 1
- 'setting the DropDownPicture to Nothing
- 'reverts to the default arrow
- Set cmdxDemo.DropDownPicture = Nothing
- End Select
- End Sub
- Private Sub cmdxDemo_Click()
- evlDrop.Add "Click"
- End Sub
- Private Sub cmdxDemo_DropDownClick(MenuData As Object)
- evlDrop.Add "DropDownClick"
- Set MenuData = mnuPopup
- End Sub
- Private Sub evlDrop_ExitClicked()
- Unload Me
- End Sub
- Private Sub Form_Load()
- Dim I
- tmrUpdateTip_Timer
- With cmdxDemo
- cboBorderStyle.ListIndex = .BorderStyle
- cboDropDownStyle.ListIndex = .DropDownStyle
- txtSize = .DropDownSize
- End With
- 'add some sample menus
- For I = 1 To 8
- Load mnuPopupItem(I)
- mnuPopupItem(I).Caption = "Item &" & (I - 1)
- Next
- End Sub
- Private Sub tmrUpdateTip_Timer()
- Static hWndCtl As Long
- Dim Tmp As Long
- Dim Act As Control
- On Error Resume Next
- Set Act = ActiveControl
- If Act Is Nothing Then
- tipDesc.Text = ""
- Else
- Tmp = Act.hWnd
- If Err = 0 And Tmp <> hWndCtl Then
- hWndCtl = Tmp
- tipDesc.Text = Act.Tag
- End If
- End If
- On Error GoTo 0
- End Sub
- Private Sub txtSize_Change()
- cmdxDemo.DropDownSize = Val(txtSize)
- End Sub
-