home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / flatbttn / frmtest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-01-18  |  26.9 KB  |  763 lines

  1. VERSION 5.00
  2. Object = "{48DC3C96-B20F-11D1-A87F-D9394DC38340}#2.9#0"; "FlatBtn2.ocx"
  3. Begin VB.Form frmTest 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "DevPower FlatBttn Control Test"
  6.    ClientHeight    =   3525
  7.    ClientLeft      =   30
  8.    ClientTop       =   270
  9.    ClientWidth     =   5070
  10.    Icon            =   "frmTest.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   235
  15.    ScaleMode       =   3  'Pixel
  16.    ScaleWidth      =   338
  17.    StartUpPosition =   2  'CenterScreen
  18.    Visible         =   0   'False
  19.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  20.       Height          =   330
  21.       Index           =   12
  22.       Left            =   15
  23.       TabIndex        =   3
  24.       Top             =   360
  25.       Width           =   885
  26.       _ExtentX        =   1561
  27.       _ExtentY        =   582
  28.       AlignCaption    =   3
  29.       AlignPicture    =   2
  30.       AutoSize        =   0   'False
  31.       Caption         =   "&Send"
  32.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  33.          Name            =   "Tahoma"
  34.          Size            =   7.5
  35.          Charset         =   0
  36.          Weight          =   400
  37.          Underline       =   0   'False
  38.          Italic          =   0   'False
  39.          Strikethrough   =   0   'False
  40.       EndProperty
  41.       MaskColor       =   16711935
  42.       MousePointer    =   1
  43.       TextColor       =   -2147483630
  44.       Object.ToolTipText     =   "New Caption / Picture Alignment features"
  45.       Picture         =   "frmTest.frx":0442
  46.    End
  47.    Begin VB.CheckBox chkEnabled 
  48.       Caption         =   "E&nabled"
  49.       Height          =   228
  50.       Index           =   1
  51.       Left            =   4008
  52.       TabIndex        =   14
  53.       Top             =   2280
  54.       Value           =   1  'Checked
  55.       Width           =   1068
  56.    End
  57.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  58.       Height          =   600
  59.       Index           =   9
  60.       Left            =   4200
  61.       TabIndex        =   15
  62.       Top             =   2550
  63.       Width           =   600
  64.       _ExtentX        =   1058
  65.       _ExtentY        =   1058
  66.       BorderStyle     =   0
  67.       Caption         =   ""
  68.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  69.          Name            =   "MS Sans Serif"
  70.          Size            =   9.75
  71.          Charset         =   0
  72.          Weight          =   400
  73.          Underline       =   0   'False
  74.          Italic          =   0   'False
  75.          Strikethrough   =   0   'False
  76.       EndProperty
  77.       MaskColor       =   16711935
  78.       MouseIcon       =   "frmTest.frx":0524
  79.       MousePointer    =   99
  80.       TextColor       =   -2147483630
  81.       Object.ToolTipText     =   "Transparent custom shapes now possible with Border-less buttons"
  82.       Transparent     =   -1  'True
  83.       MouseIcon       =   "frmTest.frx":083E
  84.       Picture         =   "frmTest.frx":0B58
  85.       PictureOver     =   "frmTest.frx":1E6A
  86.       PictureDown     =   "frmTest.frx":317C
  87.       PictureDisabled =   "frmTest.frx":448E
  88.    End
  89.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  90.       Height          =   315
  91.       Index           =   10
  92.       Left            =   0
  93.       TabIndex        =   1
  94.       TabStop         =   0   'False
  95.       Top             =   0
  96.       Width           =   480
  97.       _ExtentX        =   847
  98.       _ExtentY        =   556
  99.       Style           =   5
  100.       Caption         =   "&File"
  101.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  102.          Name            =   "MS Sans Serif"
  103.          Size            =   9.75
  104.          Charset         =   0
  105.          Weight          =   400
  106.          Underline       =   0   'False
  107.          Italic          =   0   'False
  108.          Strikethrough   =   0   'False
  109.       EndProperty
  110.       TextColor       =   -2147483630
  111.       Object.ToolTipText     =   "Menu Style Buttons"
  112.    End
  113.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  114.       Height          =   540
  115.       Index           =   7
  116.       Left            =   1965
  117.       TabIndex        =   8
  118.       Top             =   795
  119.       Width           =   675
  120.       _ExtentX        =   1191
  121.       _ExtentY        =   953
  122.       Style           =   3
  123.       Caption         =   ""
  124.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  125.          Name            =   "MS Sans Serif"
  126.          Size            =   9.75
  127.          Charset         =   0
  128.          Weight          =   400
  129.          Underline       =   0   'False
  130.          Italic          =   0   'False
  131.          Strikethrough   =   0   'False
  132.       EndProperty
  133.       MaskColor       =   16711935
  134.       TextColor       =   -2147483630
  135.       Object.ToolTipText     =   "Find Items"
  136.       Picture         =   "frmTest.frx":57A0
  137.    End
  138.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  139.       Height          =   360
  140.       Index           =   8
  141.       Left            =   1965
  142.       TabIndex        =   10
  143.       Top             =   1680
  144.       Width           =   960
  145.       _ExtentX        =   1693
  146.       _ExtentY        =   635
  147.       Style           =   4
  148.       AlignCaption    =   4
  149.       BackColor       =   -2147483632
  150.       Caption         =   "&Inbox"
  151.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  152.          Name            =   "Arial"
  153.          Size            =   12
  154.          Charset         =   0
  155.          Weight          =   700
  156.          Underline       =   0   'False
  157.          Italic          =   0   'False
  158.          Strikethrough   =   0   'False
  159.       EndProperty
  160.       MaskColor       =   -2147483633
  161.       ShadowColor     =   -2147483627
  162.       TextColor       =   -2147483643
  163.       Object.ToolTipText     =   "Click here to select view"
  164.    End
  165.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  166.       Height          =   315
  167.       Index           =   5
  168.       Left            =   1410
  169.       TabIndex        =   12
  170.       TabStop         =   0   'False
  171.       Top             =   2280
  172.       Width           =   60
  173.       _ExtentX        =   106
  174.       _ExtentY        =   556
  175.       Style           =   2
  176.       Caption         =   ""
  177.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  178.          Name            =   "MS Sans Serif"
  179.          Size            =   9.75
  180.          Charset         =   0
  181.          Weight          =   400
  182.          Underline       =   0   'False
  183.          Italic          =   0   'False
  184.          Strikethrough   =   0   'False
  185.       EndProperty
  186.       TextColor       =   -2147483630
  187.       Object.ToolTipText     =   ""
  188.    End
  189.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  190.       Cancel          =   -1  'True
  191.       Height          =   330
  192.       Index           =   4
  193.       Left            =   120
  194.       TabIndex        =   11
  195.       Top             =   2280
  196.       Width           =   1260
  197.       _ExtentX        =   2223
  198.       _ExtentY        =   582
  199.       AlignCaption    =   4
  200.       Caption         =   "&Text Only"
  201.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  202.          Name            =   "Verdana"
  203.          Size            =   10.5
  204.          Charset         =   0
  205.          Weight          =   700
  206.          Underline       =   0   'False
  207.          Italic          =   0   'False
  208.          Strikethrough   =   0   'False
  209.       EndProperty
  210.       TextColor       =   8388736
  211.       Object.ToolTipText     =   "Text Only Buttons"
  212.    End
  213.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  214.       Height          =   390
  215.       Index           =   1
  216.       Left            =   945
  217.       TabIndex        =   4
  218.       Top             =   360
  219.       Width           =   435
  220.       _ExtentX        =   767
  221.       _ExtentY        =   688
  222.       Caption         =   ""
  223.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  224.          Name            =   "MS Sans Serif"
  225.          Size            =   9.75
  226.          Charset         =   0
  227.          Weight          =   400
  228.          Underline       =   0   'False
  229.          Italic          =   0   'False
  230.          Strikethrough   =   0   'False
  231.       EndProperty
  232.       MaskColor       =   16711680
  233.       PlaySounds      =   0   'False
  234.       TextColor       =   -2147483630
  235.       Object.ToolTipText     =   "Internet Explorer Stop"
  236.       Picture         =   "frmTest.frx":5FF2
  237.       PictureOver     =   "frmTest.frx":66CC
  238.    End
  239.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  240.       Height          =   390
  241.       Index           =   2
  242.       Left            =   1425
  243.       TabIndex        =   5
  244.       Top             =   360
  245.       Width           =   435
  246.       _ExtentX        =   767
  247.       _ExtentY        =   688
  248.       Caption         =   ""
  249.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  250.          Name            =   "MS Sans Serif"
  251.          Size            =   9.75
  252.          Charset         =   0
  253.          Weight          =   400
  254.          Underline       =   0   'False
  255.          Italic          =   0   'False
  256.          Strikethrough   =   0   'False
  257.       EndProperty
  258.       MaskColor       =   255
  259.       MouseIcon       =   "frmTest.frx":6DA6
  260.       MousePointer    =   99
  261.       PlaySounds      =   0   'False
  262.       TextColor       =   -2147483630
  263.       Object.ToolTipText     =   "Internet Explorer Home"
  264.       MouseIcon       =   "frmTest.frx":6F08
  265.       Picture         =   "frmTest.frx":706A
  266.       PictureOver     =   "frmTest.frx":7744
  267.    End
  268.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  269.       Height          =   792
  270.       Index           =   3
  271.       Left            =   264
  272.       TabIndex        =   6
  273.       Top             =   792
  274.       Width           =   876
  275.       _ExtentX        =   1535
  276.       _ExtentY        =   1402
  277.       Style           =   1
  278.       AutoSize        =   0   'False
  279.       Caption         =   "Sea&rch"
  280.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  281.          Name            =   "MS Sans Serif"
  282.          Size            =   9.75
  283.          Charset         =   0
  284.          Weight          =   400
  285.          Underline       =   0   'False
  286.          Italic          =   0   'False
  287.          Strikethrough   =   0   'False
  288.       EndProperty
  289.       MaskColor       =   16711935
  290.       TextColor       =   -2147483630
  291.       Object.ToolTipText     =   "Search Button"
  292.       Picture         =   "frmTest.frx":7E1E
  293.    End
  294.    Begin VB.CheckBox chkEnabled 
  295.       Caption         =   "Search Button &Enabled"
  296.       Height          =   408
  297.       Index           =   0
  298.       Left            =   150
  299.       TabIndex        =   7
  300.       Top             =   1644
  301.       Value           =   1  'Checked
  302.       Width           =   1755
  303.    End
  304.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  305.       Height          =   330
  306.       Index           =   6
  307.       Left            =   1530
  308.       TabIndex        =   13
  309.       Top             =   2280
  310.       Width           =   2310
  311.       _ExtentX        =   4075
  312.       _ExtentY        =   582
  313.       AlignCaption    =   4
  314.       Caption         =   "&and short cut keys"
  315.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  316.          Name            =   "Verdana"
  317.          Size            =   10.5
  318.          Charset         =   0
  319.          Weight          =   700
  320.          Underline       =   0   'False
  321.          Italic          =   0   'False
  322.          Strikethrough   =   0   'False
  323.       EndProperty
  324.       TextColor       =   8388736
  325.       Object.ToolTipText     =   "New in Version 2.0 - Separators and Checkable buttons"
  326.    End
  327.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  328.       Height          =   315
  329.       Index           =   11
  330.       Left            =   480
  331.       TabIndex        =   2
  332.       TabStop         =   0   'False
  333.       Top             =   0
  334.       Width           =   585
  335.       _ExtentX        =   1032
  336.       _ExtentY        =   556
  337.       Style           =   5
  338.       Caption         =   "&Help"
  339.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  340.          Name            =   "MS Sans Serif"
  341.          Size            =   9.75
  342.          Charset         =   0
  343.          Weight          =   400
  344.          Underline       =   0   'False
  345.          Italic          =   0   'False
  346.          Strikethrough   =   0   'False
  347.       EndProperty
  348.       TextColor       =   -2147483630
  349.       Object.ToolTipText     =   "Displays Copyright Information"
  350.    End
  351.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  352.       Height          =   540
  353.       Index           =   13
  354.       Left            =   3360
  355.       TabIndex        =   9
  356.       Top             =   795
  357.       Width           =   1110
  358.       _ExtentX        =   1958
  359.       _ExtentY        =   953
  360.       Caption         =   "F&ont Direction"
  361.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  362.          Name            =   "Tahoma"
  363.          Size            =   7.5
  364.          Charset         =   0
  365.          Weight          =   400
  366.          Underline       =   0   'False
  367.          Italic          =   0   'False
  368.          Strikethrough   =   0   'False
  369.       EndProperty
  370.       MousePointer    =   1
  371.       TextColor       =   -2147483630
  372.       Object.ToolTipText     =   "Caption / Picture Alignment and Font Direction features"
  373.       Picture         =   "frmTest.frx":9A90
  374.    End
  375.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  376.       Height          =   315
  377.       Index           =   14
  378.       Left            =   120
  379.       TabIndex        =   17
  380.       Top             =   2715
  381.       Width           =   1200
  382.       _ExtentX        =   2117
  383.       _ExtentY        =   556
  384.       Style           =   10
  385.       AlignCaption    =   3
  386.       AlignPicture    =   2
  387.       Caption         =   "Non Flat"
  388.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  389.          Name            =   "MS Sans Serif"
  390.          Size            =   9.75
  391.          Charset         =   0
  392.          Weight          =   400
  393.          Underline       =   0   'False
  394.          Italic          =   0   'False
  395.          Strikethrough   =   0   'False
  396.       EndProperty
  397.       TextColor       =   -2147483640
  398.       Object.ToolTipText     =   "Non Flat Button Style"
  399.       Picture         =   "frmTest.frx":9B9A
  400.    End
  401.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  402.       Height          =   150
  403.       Index           =   15
  404.       Left            =   1515
  405.       TabIndex        =   18
  406.       Top             =   2595
  407.       Width           =   2310
  408.       _ExtentX        =   4075
  409.       _ExtentY        =   265
  410.       Style           =   9
  411.       AlignCaption    =   4
  412.       Caption         =   ""
  413.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  414.          Name            =   "Verdana"
  415.          Size            =   10.5
  416.          Charset         =   0
  417.          Weight          =   700
  418.          Underline       =   0   'False
  419.          Italic          =   0   'False
  420.          Strikethrough   =   0   'False
  421.       EndProperty
  422.       TextColor       =   8388736
  423.       Object.ToolTipText     =   ""
  424.    End
  425.    Begin DevPowerFlatBttn.FlatBttn FlatButton 
  426.       Default         =   -1  'True
  427.       Height          =   315
  428.       Index           =   16
  429.       Left            =   1515
  430.       TabIndex        =   19
  431.       Top             =   2760
  432.       Width           =   2310
  433.       _ExtentX        =   4075
  434.       _ExtentY        =   556
  435.       Style           =   6
  436.       AlignCaption    =   2
  437.       AlignPicture    =   2
  438.       Caption         =   "Menu Item Style"
  439.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  440.          Name            =   "MS Sans Serif"
  441.          Size            =   9.75
  442.          Charset         =   0
  443.          Weight          =   400
  444.          Underline       =   0   'False
  445.          Italic          =   0   'False
  446.          Strikethrough   =   0   'False
  447.       EndProperty
  448.       TextColor       =   -2147483640
  449.       Object.ToolTipText     =   "Menu Item Style"
  450.       Picture         =   "frmTest.frx":9CA4
  451.    End
  452.    Begin VB.Line MenuLine 
  453.       BorderColor     =   &H80000010&
  454.       Index           =   2
  455.       X1              =   0
  456.       X2              =   508
  457.       Y1              =   52
  458.       Y2              =   52
  459.    End
  460.    Begin VB.Line MenuLine 
  461.       BorderColor     =   &H80000014&
  462.       Index           =   1
  463.       X1              =   0
  464.       X2              =   508
  465.       Y1              =   23
  466.       Y2              =   23
  467.    End
  468.    Begin VB.Line MenuLine 
  469.       BorderColor     =   &H80000010&
  470.       Index           =   0
  471.       X1              =   0
  472.       X2              =   508
  473.       Y1              =   22
  474.       Y2              =   22
  475.    End
  476.    Begin VB.Label lblTrans 
  477.       Caption         =   "Transparent Borderless button:"
  478.       Height          =   870
  479.       Left            =   3960
  480.       TabIndex        =   16
  481.       Top             =   1440
  482.       Width           =   1170
  483.    End
  484.    Begin VB.Shape shpTransparent 
  485.       BorderColor     =   &H80000010&
  486.       BorderStyle     =   0  'Transparent
  487.       FillColor       =   &H00C0C0FF&
  488.       FillStyle       =   0  'Solid
  489.       Height          =   2436
  490.       Left            =   4428
  491.       Top             =   1920
  492.       Width           =   720
  493.    End
  494.    Begin VB.Label lblMessages 
  495.       BackStyle       =   0  'Transparent
  496.       Caption         =   "Button Events"
  497.       Height          =   345
  498.       Left            =   45
  499.       TabIndex        =   0
  500.       Top             =   3150
  501.       Width           =   4215
  502.    End
  503.    Begin VB.Menu m_popup 
  504.       Caption         =   "popup"
  505.       Visible         =   0   'False
  506.       Begin VB.Menu m_findfiles 
  507.          Caption         =   "Find Files..."
  508.       End
  509.       Begin VB.Menu m_findcomputer 
  510.          Caption         =   "Find Computer..."
  511.       End
  512.    End
  513.    Begin VB.Menu m_rolldown 
  514.       Caption         =   "rolldown"
  515.       Visible         =   0   'False
  516.       Begin VB.Menu m_Inbox 
  517.          Caption         =   "Inbox"
  518.       End
  519.       Begin VB.Menu m_calendar 
  520.          Caption         =   "Calendar"
  521.       End
  522.    End
  523.    Begin VB.Menu m_file 
  524.       Caption         =   "file"
  525.       Visible         =   0   'False
  526.       Begin VB.Menu m_new 
  527.          Caption         =   "&New"
  528.       End
  529.       Begin VB.Menu m_open 
  530.          Caption         =   "&Open..."
  531.       End
  532.       Begin VB.Menu m_save 
  533.          Caption         =   "&Save..."
  534.       End
  535.       Begin VB.Menu file_sep 
  536.          Caption         =   "-"
  537.       End
  538.       Begin VB.Menu m_exit 
  539.          Caption         =   "E&xit"
  540.       End
  541.    End
  542.    Begin VB.Menu m_help 
  543.       Caption         =   "help"
  544.       Visible         =   0   'False
  545.       Begin VB.Menu m_about 
  546.          Caption         =   "&About..."
  547.       End
  548.    End
  549. Attribute VB_Name = "frmTest"
  550. Attribute VB_GlobalNameSpace = False
  551. Attribute VB_Creatable = False
  552. Attribute VB_PredeclaredId = True
  553. Attribute VB_Exposed = False
  554. Option Base 1
  555. Private Const idSTOP = 1
  556. Private Const idHOME = 2
  557. Private Const idSEARCH = 3
  558. Private Const idTEXT = 4
  559. Private Const idSEPARATOR = 5
  560. Private Const idSHORTCUT = 6
  561. Private Const idFIND = 7
  562. Private Const idOUTLOOK = 8
  563. Private Const idTRANSPARENT = 9
  564. Private Const idFILE = 10
  565. Private Const idHELP = 11
  566. Private Const idSEND = 12
  567. Private Const idFONTDIR = 13
  568. Private Const idNONFLAT = 14
  569. Private Const idMENUITEMSEPERATOR = 15
  570. Private Const idMENUITEM = 16
  571. Private Sub chkEnabled_Click(Index As Integer)
  572.     If Index = 0 Then
  573.         FlatButton(idSEARCH).Enabled = chkEnabled(Index).Value And vbChecked
  574.     Else
  575.         FlatButton(idTRANSPARENT).Enabled = chkEnabled(Index).Value And vbChecked
  576.     End If
  577. End Sub
  578. Private Sub FlatButton_Click(Index As Integer)
  579.     CancelDropDowns
  580.     Dim sName As String
  581.     sName = "'" + FlatButton(Index).Caption + "'"
  582.     If sName = "''" Then sName = CStr(Index)
  583.     If FlatButton(Index).Style = Check Then
  584.         If FlatButton(Index).Checked Then
  585.             lblMessages.Caption = "Button " + sName + " Checked"
  586.         Else
  587.             lblMessages.Caption = "Button " + sName + " UnChecked"
  588.         End If
  589.     Else
  590.         lblMessages.Caption = "Button " + sName + " Clicked"
  591.     End If
  592.     If Index = idFONTDIR Then
  593.         If FlatButton(Index).FontDirection < 3 Then
  594.             FlatButton(Index).FontDirection = FlatButton(Index).FontDirection + 1
  595.         Else
  596.             FlatButton(Index).FontDirection = 0
  597.         End If
  598.     End If
  599. End Sub
  600. Private Sub FlatButton_DropDown(Index As Integer)
  601.     Dim sName As String
  602.     sName = "'" + FlatButton(Index).Caption + "'"
  603.     If sName = "''" Then sName = CStr(Index)
  604.     lblMessages.Caption = "Button " + sName + " Dropped Down"
  605.     If Index = idFIND Then
  606.         FlatButton(idOUTLOOK).CancelDropDown
  607.         FlatButton(idFILE).CancelDropDown
  608.         FlatButton(idHELP).CancelDropDown
  609.         PopupMenu m_popup, , FlatButton(Index).Left, FlatButton(Index).Top + FlatButton(Index).Height
  610.     ElseIf Index = idOUTLOOK Then
  611.         FlatButton(idFIND).CancelDropDown
  612.         FlatButton(idFILE).CancelDropDown
  613.         FlatButton(idHELP).CancelDropDown
  614.         PopupMenu m_rolldown, , FlatButton(Index).Left, FlatButton(Index).Top + FlatButton(Index).Height
  615.     ElseIf Index = idFILE Then
  616.         FlatButton(idFIND).CancelDropDown
  617.         FlatButton(idOUTLOOK).CancelDropDown
  618.         FlatButton(idHELP).CancelDropDown
  619.         PopupMenu m_file, , FlatButton(Index).Left, FlatButton(Index).Top + FlatButton(Index).Height
  620.     ElseIf Index = idHELP Then
  621.         FlatButton(idFIND).CancelDropDown
  622.         FlatButton(idOUTLOOK).CancelDropDown
  623.         FlatButton(idFILE).CancelDropDown
  624.         PopupMenu m_help, , FlatButton(Index).Left, FlatButton(Index).Top + FlatButton(Index).Height
  625.     End If
  626. End Sub
  627. Private Sub FlatButton_DropDownCancelled(Index As Integer)
  628.     lblMessages.Caption = "Button " + CStr(Index) + " Drop Down Cancelled"
  629. End Sub
  630. Private Sub FlatButton_KeyPress(Index As Integer, keyAscii As Integer)
  631.     ' If the user presses the left or right arrows
  632.     ' when one of the drop downs is active, move to the
  633.     ' dropdowns pair control.
  634.     ' This would work if we weren't using a VB menu,
  635.     ' but instead using a custom window...
  636.     If FlatButton(Index).DroppedDown Then
  637.         If keyAscii = vbKeyRight Then
  638.             If Index = idFIND Or Index = idFILE Then
  639.                 FlatButton(Index).CancelDropDown
  640.                 FlatButton(Index + 1).Value = True
  641.             End If
  642.         ElseIf keyAscii = vbKeyLeft Then
  643.             If Index = idOUTLOOK Or Index = idHELP Then
  644.                 FlatButton(Index).CancelDropDown
  645.                 FlatButton(Index - 1).Value = True
  646.             End If
  647.         End If
  648.     End If
  649. End Sub
  650. Private Sub FlatButton_MouseDown(Index As Integer, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
  651.     ' Commented out so that Click Event Message can be seen:
  652.     'lblMessages.Caption = "Button " + CStr(Index) + " MouseDown"
  653. End Sub
  654. Private Sub FlatButton_MouseMove(Index As Integer, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
  655.     ' Commented out so that Click Event Message can be seen:
  656.     'lblMessages.Caption = "Button " + CStr(Index) + " MouseMove"
  657. End Sub
  658. Private Sub FlatButton_MouseUp(Index As Integer, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
  659.     ' Commented out so that Click Event Message can be seen:
  660.     'lblMessages.Caption = "Button " + CStr(Index) + " MouseUp"
  661. End Sub
  662. Private Sub FlatButton_PropertyDownloaded(Index As Integer, ByVal sProperty As String)
  663.     lblMessages.Caption = "Button " + CStr(Index) + " " + sProperty + " Property downloaded"
  664. End Sub
  665. Private Sub FlatButton_Resize(Index As Integer, Width As Long, Height As Long)
  666.     lblMessages.Caption = "Button " + CStr(Index) + " Resized"
  667. End Sub
  668. Private Sub FlatButton_RightClick(Index As Integer)
  669.     lblMessages.Caption = "Button " + CStr(Index) + " Right Clicked"
  670. End Sub
  671. Private Sub Form_Click()
  672.     ' Cancel DropDowns:
  673.     CancelDropDowns
  674. End Sub
  675. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
  676.     If KeyCode = vbKeyEscape Then
  677.         CancelDropDowns
  678.     End If
  679. End Sub
  680. Private Sub Form_Load()
  681.     On Error Resume Next
  682.     MenuLine(0).Y1 = FlatButton(idHELP).Top + FlatButton(idHELP).Height + 1
  683.     MenuLine(0).Y2 = MenuLine(0).Y1
  684.     MenuLine(1).Y1 = MenuLine(0).Y1 + 1
  685.     MenuLine(1).Y2 = MenuLine(1).Y1
  686.     FlatButton(idSTOP).Left = FlatButton(idSEND).Left + FlatButton(idSEND).Width + 1
  687.     FlatButton(idSEND).Top = MenuLine(1).Y1 + 2
  688.     FlatButton(idSEND).Height = FlatButton(idHOME).Height
  689.     FlatButton(idHOME).Top = FlatButton(idSEND).Top
  690.     FlatButton(idSTOP).Top = FlatButton(idSEND).Top
  691.     MenuLine(2).Y1 = FlatButton(idSTOP).Top + FlatButton(idSTOP).Height + 1
  692.     MenuLine(2).Y2 = MenuLine(2).Y1
  693.     FlatButton(idHOME).Left = FlatButton(idSTOP).Left + FlatButton(idSTOP).Width + 1
  694.     FlatButton(idSEPARATOR).Left = FlatButton(idTEXT).Left + FlatButton(idTEXT).Width + 1
  695.     FlatButton(idSHORTCUT).Left = FlatButton(idSEPARATOR).Left + FlatButton(idSEPARATOR).Width + 1
  696.     FlatButton(idHELP).Left = FlatButton(idFILE).Left + FlatButton(idFILE).Width + 1
  697.     FlatButton(idMENUITEM).Left = FlatButton(idSHORTCUT).Left
  698.     FlatButton(idMENUITEMSEPERATOR).Left = FlatButton(idSHORTCUT).Left
  699.     FlatButton(idMENUITEM).Top = FlatButton(idMENUITEMSEPERATOR).Top + FlatButton(idMENUITEMSEPERATOR).Height
  700.     FlatButton(idNONFLAT).Top = FlatButton(idMENUITEM).Top
  701.         
  702.     lblMessages.Caption = "FlatButton Version " + FlatButton(idSTOP).Version
  703.     lblMessages.Caption = lblMessages.Caption + FlatButton(idSTOP).VBVersion
  704.     DoEvents
  705.     Me.Show
  706. End Sub
  707. Private Sub Form_LostFocus()
  708.     CancelDropDowns
  709. End Sub
  710. Private Sub lblMessages_Click()
  711.     CancelDropDowns
  712. End Sub
  713. Private Sub m_about_Click()
  714.     CancelDropDowns
  715.     FlatButton(1).AboutBox
  716. End Sub
  717. Private Sub m_exit_Click()
  718.     Unload Me
  719. End Sub
  720. Private Sub m_findcomputer_Click()
  721.     lblMessages.Caption = "Find Computer Clicked"
  722.     ' Cancel DropDowns:
  723.     CancelDropDowns
  724. End Sub
  725. Private Sub m_findfiles_Click()
  726.     lblMessages.Caption = "Find Files Clicked"
  727.     ' Cancel DropDowns:
  728.     CancelDropDowns
  729. End Sub
  730. Private Sub m_Inbox_Click()
  731.     lblMessages.Caption = "Inbox Selected"
  732.     FlatButton(idOUTLOOK).Caption = "&Inbox"
  733.     ' Cancel DropDowns:
  734.     CancelDropDowns
  735. End Sub
  736. Private Sub m_calendar_Click()
  737.     lblMessages.Caption = "Calendar Selected"
  738.     FlatButton(idOUTLOOK).Caption = "&Calendar"
  739.     ' Cancel DropDowns:
  740.     CancelDropDowns
  741. End Sub
  742. Private Sub m_new_Click()
  743.     lblMessages.Caption = "New Selected"
  744.     ' Cancel DropDowns:
  745.     CancelDropDowns
  746. End Sub
  747. Private Sub m_open_Click()
  748.     lblMessages.Caption = "Open Selected"
  749.     ' Cancel DropDowns:
  750.     CancelDropDowns
  751. End Sub
  752. Private Sub m_save_Click()
  753.     lblMessages.Caption = "Save Selected"
  754.     ' Cancel DropDowns:
  755.     CancelDropDowns
  756. End Sub
  757. Private Sub CancelDropDowns()
  758.     FlatButton(idFIND).CancelDropDown
  759.     FlatButton(idOUTLOOK).CancelDropDown
  760.     FlatButton(idFILE).CancelDropDown
  761.     FlatButton(idHELP).CancelDropDown
  762. End Sub
  763.