home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / swbbtnbr / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-04-27  |  15.0 KB  |  402 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{511C3C9E-3AF1-11D2-AD63-004005448951}#42.5#0"; "SWBBTNBAR.OCX"
  4. Begin VB.Form Form1 
  5.    AutoRedraw      =   -1  'True
  6.    Caption         =   "SWBBtnBar Demo Application"
  7.    ClientHeight    =   4365
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   4950
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4365
  15.    ScaleWidth      =   4950
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.CheckBox chkShowFocus 
  18.       Caption         =   "Show &Group Focus"
  19.       Height          =   240
  20.       Left            =   1935
  21.       TabIndex        =   12
  22.       Top             =   3690
  23.       Value           =   1  'Checked
  24.       Width           =   1995
  25.    End
  26.    Begin SWBBtnBar.BtnBar BtnBar 
  27.       Align           =   3  'Align Left
  28.       Height          =   4020
  29.       Left            =   0
  30.       TabIndex        =   11
  31.       Top             =   0
  32.       Width           =   1770
  33.       _ExtentX        =   3122
  34.       _ExtentY        =   7091
  35.       LastDesignGroup =   0
  36.       BorderStyle     =   2
  37.       GroupBtnHeight  =   340
  38.       GroupBtnVGap    =   0
  39.       BorderVGap      =   15
  40.       BorderHGap      =   15
  41.       ScrollBtnSize   =   195
  42.       ScrollBtnVGap   =   30
  43.       ScrollBtnHGap   =   60
  44.       ShowFocusBorder =   -1  'True
  45.    End
  46.    Begin VB.Frame Frame2 
  47.       Caption         =   "Button Images"
  48.       Height          =   915
  49.       Left            =   1935
  50.       TabIndex        =   8
  51.       Top             =   2340
  52.       Width           =   1905
  53.       Begin VB.OptionButton optImageSize 
  54.          Caption         =   "Small Images"
  55.          Height          =   240
  56.          Index           =   1
  57.          Left            =   135
  58.          TabIndex        =   10
  59.          Top             =   585
  60.          Width           =   1365
  61.       End
  62.       Begin VB.OptionButton optImageSize 
  63.          Caption         =   "Large Images"
  64.          Height          =   240
  65.          Index           =   0
  66.          Left            =   135
  67.          TabIndex        =   9
  68.          Top             =   270
  69.          Value           =   -1  'True
  70.          Width           =   1365
  71.       End
  72.    End
  73.    Begin MSComctlLib.ImageList imgSmallList 
  74.       Left            =   4275
  75.       Top             =   3330
  76.       _ExtentX        =   1005
  77.       _ExtentY        =   1005
  78.       BackColor       =   -2147483643
  79.       ImageWidth      =   16
  80.       ImageHeight     =   16
  81.       MaskColor       =   12632256
  82.       _Version        =   393216
  83.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  84.          NumListImages   =   11
  85.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  86.             Picture         =   "Form1.frx":0000
  87.             Key             =   "CD-ROM"
  88.          EndProperty
  89.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  90.             Picture         =   "Form1.frx":015C
  91.             Key             =   "Inbox"
  92.          EndProperty
  93.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  94.             Picture         =   "Form1.frx":02B8
  95.             Key             =   "My Computer"
  96.          EndProperty
  97.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  98.             Picture         =   "Form1.frx":0414
  99.             Key             =   "Desktop"
  100.          EndProperty
  101.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  102.             Picture         =   "Form1.frx":0570
  103.             Key             =   "Internet"
  104.          EndProperty
  105.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  106.             Picture         =   "Form1.frx":06CC
  107.             Key             =   "Explorer"
  108.          EndProperty
  109.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  110.             Picture         =   "Form1.frx":0828
  111.             Key             =   "Audio CD"
  112.          EndProperty
  113.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  114.             Picture         =   "Form1.frx":0984
  115.             Key             =   "User Security"
  116.          EndProperty
  117.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  118.             Picture         =   "Form1.frx":0AE0
  119.             Key             =   "Notes"
  120.          EndProperty
  121.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  122.             Picture         =   "Form1.frx":0C3C
  123.             Key             =   "Graphs"
  124.          EndProperty
  125.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  126.             Picture         =   "Form1.frx":0D98
  127.             Key             =   "E-Mail"
  128.          EndProperty
  129.       EndProperty
  130.    End
  131.    Begin VB.ComboBox cboPropState 
  132.       Height          =   315
  133.       ItemData        =   "Form1.frx":0EF4
  134.       Left            =   1935
  135.       List            =   "Form1.frx":0F01
  136.       Style           =   2  'Dropdown List
  137.       TabIndex        =   7
  138.       Top             =   1755
  139.       Width           =   1995
  140.    End
  141.    Begin VB.CheckBox chkShowCaptions 
  142.       Caption         =   "&Show Captions"
  143.       Height          =   240
  144.       Left            =   1935
  145.       TabIndex        =   5
  146.       Top             =   3420
  147.       Width           =   1410
  148.    End
  149.    Begin VB.Frame Frame1 
  150.       Height          =   1365
  151.       Left            =   1935
  152.       TabIndex        =   1
  153.       Top             =   45
  154.       Width           =   2850
  155.       Begin VB.Label Label3 
  156.          AutoSize        =   -1  'True
  157.          Caption         =   "All rights reserved."
  158.          Height          =   195
  159.          Left            =   135
  160.          TabIndex        =   4
  161.          Top             =   990
  162.          Width           =   1290
  163.       End
  164.       Begin VB.Label Label2 
  165.          AutoSize        =   -1  'True
  166.          Caption         =   "
  167. 1998 Software with Brains, Inc."
  168.          Height          =   195
  169.          Left            =   135
  170.          TabIndex        =   3
  171.          Top             =   720
  172.          Width           =   2340
  173.       End
  174.       Begin VB.Label Label1 
  175.          AutoSize        =   -1  'True
  176.          Caption         =   "Software with Brains, Inc."
  177.          BeginProperty Font 
  178.             Name            =   "MS Sans Serif"
  179.             Size            =   9.75
  180.             Charset         =   0
  181.             Weight          =   700
  182.             Underline       =   0   'False
  183.             Italic          =   0   'False
  184.             Strikethrough   =   0   'False
  185.          EndProperty
  186.          Height          =   240
  187.          Left            =   135
  188.          TabIndex        =   2
  189.          Top             =   225
  190.          Width           =   2565
  191.       End
  192.    End
  193.    Begin MSComctlLib.StatusBar StatusBar1 
  194.       Align           =   2  'Align Bottom
  195.       Height          =   345
  196.       Left            =   0
  197.       TabIndex        =   0
  198.       Top             =   4020
  199.       Width           =   4950
  200.       _ExtentX        =   8731
  201.       _ExtentY        =   609
  202.       _Version        =   393216
  203.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  204.          NumPanels       =   2
  205.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  206.             Object.Width           =   4410
  207.             MinWidth        =   4410
  208.          EndProperty
  209.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  210.             Object.Width           =   4410
  211.             MinWidth        =   4410
  212.          EndProperty
  213.       EndProperty
  214.    End
  215.    Begin MSComctlLib.ImageList imgLargeList 
  216.       Left            =   4290
  217.       Top             =   2640
  218.       _ExtentX        =   1005
  219.       _ExtentY        =   1005
  220.       BackColor       =   -2147483643
  221.       ImageWidth      =   32
  222.       ImageHeight     =   32
  223.       MaskColor       =   12632256
  224.       _Version        =   393216
  225.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  226.          NumListImages   =   11
  227.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  228.             Picture         =   "Form1.frx":0F23
  229.             Key             =   "CD-ROM"
  230.          EndProperty
  231.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  232.             Picture         =   "Form1.frx":1377
  233.             Key             =   "Inbox"
  234.          EndProperty
  235.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  236.             Picture         =   "Form1.frx":17CB
  237.             Key             =   "My Computer"
  238.          EndProperty
  239.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  240.             Picture         =   "Form1.frx":1C1F
  241.             Key             =   "Desktop"
  242.          EndProperty
  243.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  244.             Picture         =   "Form1.frx":2073
  245.             Key             =   "Internet"
  246.          EndProperty
  247.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  248.             Picture         =   "Form1.frx":24C7
  249.             Key             =   "Explorer"
  250.          EndProperty
  251.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  252.             Picture         =   "Form1.frx":291B
  253.             Key             =   "Audio CD"
  254.          EndProperty
  255.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  256.             Picture         =   "Form1.frx":2D6F
  257.             Key             =   "User Security"
  258.          EndProperty
  259.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  260.             Picture         =   "Form1.frx":31C3
  261.             Key             =   "Notes"
  262.          EndProperty
  263.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  264.             Picture         =   "Form1.frx":3617
  265.             Key             =   "Graphs"
  266.          EndProperty
  267.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  268.             Picture         =   "Form1.frx":3A6B
  269.             Key             =   "E-Mail"
  270.          EndProperty
  271.       EndProperty
  272.    End
  273.    Begin VB.Label Label4 
  274.       AutoSize        =   -1  'True
  275.       Caption         =   "Show ""My Computer"" Icon as:"
  276.       Height          =   195
  277.       Left            =   1935
  278.       TabIndex        =   6
  279.       Top             =   1530
  280.       Width           =   2145
  281.    End
  282. Attribute VB_Name = "Form1"
  283. Attribute VB_GlobalNameSpace = False
  284. Attribute VB_Creatable = False
  285. Attribute VB_PredeclaredId = True
  286. Attribute VB_Exposed = False
  287. '**********************************************
  288. '        SWBBtnBar Sample Application
  289. '**********************************************
  290. Option Explicit
  291. Private Sub BtnBar_GroupClick(GroupKey As String)
  292.     'The GroupClick event notifies the application
  293.     'that the user has changed groups by clicking on
  294.     'a new group button.  Use the GroupKey to identify
  295.     'the newly selected group.
  296.     StatusBar1.Panels(1).Text = "Group: '" & GroupKey & "'"
  297.     StatusBar1.Panels(2).Text = ""
  298. End Sub
  299. Private Sub BtnBar_ItemClick(ItemKey As String)
  300.     'The ItemClick event notifies the application
  301.     'that the user has selected an item by clicking
  302.     'on it.  Use the ItemKey to identify the selected
  303.     'item.
  304.     StatusBar1.Panels(2).Text = "Item: '" & ItemKey & "'"
  305. End Sub
  306. Private Sub cboPropState_Click()
  307.     'Change the button state of the "My Computer" button
  308.     'in the "Computer" group.
  309.     Select Case cboPropState.ListIndex
  310.         Case 0:  BtnBar.Items("My Computer").State = isFlat
  311.         Case 1:  BtnBar.Items("My Computer").State = isDisabled
  312.         Case 2:  BtnBar.Items("My Computer").State = isInvisible
  313.     End Select
  314.     'Show the new button state
  315.     BtnBar.ChangeGroup "Computer"
  316. End Sub
  317. Private Sub chkShowCaptions_Click()
  318.     'Change the captions display status
  319.     BtnBar.ShowCaptions = (chkShowCaptions = vbChecked)
  320.     'Redraw the button bar with or without captions
  321.     BtnBar.Refresh
  322. End Sub
  323. Private Sub chkShowFocus_Click()
  324.     BtnBar.ShowFocusBorder = (chkShowFocus.Value = vbChecked)
  325. End Sub
  326. Private Sub Form_Load()
  327.     'Set up the Button Bar:
  328.     'Set the image list name.
  329.     'Add groups, each with a unique key string.
  330.     'Add buttons to each existing group, each with a unique key string.
  331.     'Select a group for display upon startup.
  332.     'Notes:
  333.     '[position] is optional and only supplied when inserting a
  334.     'new item or group into an existing set of items or groups.
  335.     'The position must be valid (1 .. Number of Items or Groups).
  336.     '
  337.     'Keys for groups must be unique within the list of groups.
  338.     'Keys for items must be unique within the list of all items (regardless of group).
  339.     BtnBar.BorderVGap = 15
  340.     BtnBar.BorderHGap = 15
  341.     BtnBar.GroupBtnVGap = 15
  342.     BtnBar.ScrollBtnSize = 235
  343.     BtnBar.GroupBtnHeight = 345
  344.         
  345.     SetLargeImages
  346.     'Create 3 groups
  347.     'Syntax:  BtnBar.AddGroup  caption, groupkey, [position]
  348.     BtnBar.AddGroup "Computer", "Computer"
  349.     BtnBar.AddGroup "Accessories", "Accessories"
  350.     BtnBar.AddGroup "Other", "Other"
  351.         
  352.     'Add buttons to Computer group
  353.     'Syntax:  BtnBar.AddItem  groupkey, caption, itemkey, imageindex, [position]
  354.     BtnBar.AddItem "Computer", "CD-ROM", "CD-ROM", 1
  355.     BtnBar.AddItem "Computer", "Inbox", "Inbox", 2
  356.     BtnBar.AddItem "Computer", "My Computer", "My Computer", 3
  357.     BtnBar.AddItem "Computer", "Desktop", "Desktop", 4
  358.     BtnBar.AddItem "Computer", "Internet", "Internet", 5
  359.     'Add buttons to Accessories group
  360.     BtnBar.AddItem "Accessories", "Explorer", "Explorer", 6
  361.     BtnBar.AddItem "Accessories", "Audio CD", "Audio CD", 7
  362.     BtnBar.AddItem "Accessories", "User Security", "User Security", 8
  363.     'Add buttons to Other group
  364.     BtnBar.AddItem "Other", "Notes", "Notes", 9
  365.     BtnBar.AddItem "Other", "Graphs", "Graphs", 10
  366.     BtnBar.AddItem "Other", "E-Mail", "E-Mail", 11
  367.     'Display Computer group upon startup (specify groupkey).
  368.     BtnBar.ChangeGroup "Computer"
  369.     'Force the current groupkey to appear in the status bar at startup.
  370.     BtnBar_GroupClick ("Computer")
  371.     'Initialize the state combo & checkbox
  372.     cboPropState.ListIndex = 0
  373.     chkShowCaptions.Value = vbChecked
  374. End Sub
  375. Private Sub SetLargeImages()
  376.     BtnBar.ItemHeight = 600
  377.     BtnBar.ItemWidth = 600
  378.     BtnBar.ImageList = "imgLargeList"
  379.     BtnBar.ItemCaptionPos = icBottom
  380.     BtnBar.ItemVertGap = 120
  381.     BtnBar.Refresh
  382. End Sub
  383. Private Sub SetSmallImages()
  384.     BtnBar.ItemHeight = 300
  385.     BtnBar.ItemWidth = 300
  386.     BtnBar.ImageList = "imgSmallList"
  387.     BtnBar.ItemCaptionPos = icRight
  388.     BtnBar.ItemVertGap = 60
  389.     BtnBar.Refresh
  390. End Sub
  391. Private Sub Form_Resize()
  392.     If (Me.Width < 5070) Then Me.Width = 5070
  393.     If (Me.Height < 4700) Then Me.Height = 4700
  394. End Sub
  395. Private Sub optImageSize_Click(Index As Integer)
  396.     If (Index = 0) Then
  397.         SetLargeImages
  398.     Else
  399.         SetSmallImages
  400.     End If
  401. End Sub
  402.