home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / swbmenub / testform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-24  |  2.9 KB  |  90 lines

  1. VERSION 5.00
  2. Object = "{DC4BAECF-5032-11D2-AD63-004005448951}#2.1#0"; "SWBMENUBTN.OCX"
  3. Begin VB.Form TestForm 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "SWBMenuBtn Sample Application"
  6.    ClientHeight    =   2490
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   3645
  10.    Icon            =   "TestForm1.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   2490
  15.    ScaleWidth      =   3645
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin SWBMenuBtn.SWBMenuButton SWBMenuButton1 
  18.       Height          =   420
  19.       Left            =   360
  20.       TabIndex        =   3
  21.       Top             =   315
  22.       Width           =   1455
  23.       _ExtentX        =   2566
  24.       _ExtentY        =   741
  25.       FontSize        =   8.25
  26.    End
  27.    Begin VB.CheckBox chkEnabled 
  28.       Caption         =   "&Enabled"
  29.       Height          =   195
  30.       Left            =   2205
  31.       TabIndex        =   2
  32.       Top             =   2025
  33.       Value           =   1  'Checked
  34.       Width           =   1095
  35.    End
  36.    Begin VB.Frame Frame1 
  37.       Caption         =   "Selection"
  38.       Height          =   1050
  39.       Left            =   2205
  40.       TabIndex        =   1
  41.       Top             =   270
  42.       Width           =   1050
  43.       Begin VB.Image imgPhoto 
  44.          Height          =   555
  45.          Left            =   225
  46.          Top             =   315
  47.          Width           =   600
  48.       End
  49.    End
  50.    Begin VB.Label lblLastChoice 
  51.       Alignment       =   2  'Center
  52.       BorderStyle     =   1  'Fixed Single
  53.       Height          =   285
  54.       Left            =   2205
  55.       TabIndex        =   0
  56.       Top             =   1440
  57.       Width           =   1050
  58.    End
  59. Attribute VB_Name = "TestForm"
  60. Attribute VB_GlobalNameSpace = False
  61. Attribute VB_Creatable = False
  62. Attribute VB_PredeclaredId = True
  63. Attribute VB_Exposed = False
  64. Option Explicit
  65. Private Sub chkEnabled_Click()
  66.     SWBMenuButton1.Enabled = chkEnabled.Value
  67. End Sub
  68. Private Sub Form_Load()
  69.     SWBMenuButton1.Caption = "Icons"
  70.     SWBMenuButton1.ClearMenu
  71.     SWBMenuButton1.ShowDropArrow = True
  72.     SWBMenuButton1.MenuAlignment = maRightAlign
  73.     SWBMenuButton1.AddMenuItem "&Bicycle"
  74.     SWBMenuButton1.AddMenuItem "&Airplane"
  75.     SWBMenuButton1.AddMenuItem "&Wrench"
  76.     SWBMenuButton1.AddMenuItem "&Rocket"
  77.     SWBMenuButton1.AddMenuItem "&Cars"
  78.     SWBMenuButton1.AddMenuItem "-"
  79.     SWBMenuButton1.AddMenuItem "&None"
  80. End Sub
  81. Private Sub SWBMenuButton1_Click(MenuItemIndex As Integer, MenuItemCaption As String)
  82.     If (MenuItemIndex <= 5) Then
  83.         lblLastChoice.Caption = Mid$(MenuItemCaption, 2)
  84.         Set imgPhoto.Picture = LoadResPicture(MenuItemIndex + 100, vbResIcon)
  85.     Else
  86.         lblLastChoice.Caption = ""
  87.         Set imgPhoto.Picture = LoadPicture("")
  88.     End If
  89. End Sub
  90.