home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{DC4BAECF-5032-11D2-AD63-004005448951}#2.1#0"; "SWBMENUBTN.OCX"
- Begin VB.Form TestForm
- BorderStyle = 1 'Fixed Single
- Caption = "SWBMenuBtn Sample Application"
- ClientHeight = 2490
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 3645
- Icon = "TestForm1.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2490
- ScaleWidth = 3645
- StartUpPosition = 2 'CenterScreen
- Begin SWBMenuBtn.SWBMenuButton SWBMenuButton1
- Height = 420
- Left = 360
- TabIndex = 3
- Top = 315
- Width = 1455
- _ExtentX = 2566
- _ExtentY = 741
- FontSize = 8.25
- End
- Begin VB.CheckBox chkEnabled
- Caption = "&Enabled"
- Height = 195
- Left = 2205
- TabIndex = 2
- Top = 2025
- Value = 1 'Checked
- Width = 1095
- End
- Begin VB.Frame Frame1
- Caption = "Selection"
- Height = 1050
- Left = 2205
- TabIndex = 1
- Top = 270
- Width = 1050
- Begin VB.Image imgPhoto
- Height = 555
- Left = 225
- Top = 315
- Width = 600
- End
- End
- Begin VB.Label lblLastChoice
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Height = 285
- Left = 2205
- TabIndex = 0
- Top = 1440
- Width = 1050
- End
- Attribute VB_Name = "TestForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub chkEnabled_Click()
- SWBMenuButton1.Enabled = chkEnabled.Value
- End Sub
- Private Sub Form_Load()
- SWBMenuButton1.Caption = "Icons"
- SWBMenuButton1.ClearMenu
- SWBMenuButton1.ShowDropArrow = True
- SWBMenuButton1.MenuAlignment = maRightAlign
- SWBMenuButton1.AddMenuItem "&Bicycle"
- SWBMenuButton1.AddMenuItem "&Airplane"
- SWBMenuButton1.AddMenuItem "&Wrench"
- SWBMenuButton1.AddMenuItem "&Rocket"
- SWBMenuButton1.AddMenuItem "&Cars"
- SWBMenuButton1.AddMenuItem "-"
- SWBMenuButton1.AddMenuItem "&None"
- End Sub
- Private Sub SWBMenuButton1_Click(MenuItemIndex As Integer, MenuItemCaption As String)
- If (MenuItemIndex <= 5) Then
- lblLastChoice.Caption = Mid$(MenuItemCaption, 2)
- Set imgPhoto.Picture = LoadResPicture(MenuItemIndex + 100, vbResIcon)
- Else
- lblLastChoice.Caption = ""
- Set imgPhoto.Picture = LoadPicture("")
- End If
- End Sub
-