home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhchk / mhgchk_a.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-11-30  |  20.7 KB  |  555 lines

  1. VERSION 4.00
  2. Begin VB.Form fMain 
  3.    Caption         =   "MicroHelp VBTools 5 - Mh3dCheck Example (OCX32)"
  4.    ClientHeight    =   4275
  5.    ClientLeft      =   1500
  6.    ClientTop       =   2370
  7.    ClientWidth     =   8640
  8.    Height          =   4680
  9.    Left            =   1440
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    ScaleHeight     =   4275
  13.    ScaleWidth      =   8640
  14.    Top             =   2025
  15.    Width           =   8760
  16.    Begin VB.CommandButton cmdAction 
  17.       Caption         =   "E&xit"
  18.       Height          =   510
  19.       Left            =   6885
  20.       TabIndex        =   14
  21.       Top             =   3600
  22.       Width           =   1590
  23.    End
  24.    Begin VB.Frame frmCheck 
  25.       Caption         =   "frmCheck(1)"
  26.       Height          =   2625
  27.       Index           =   1
  28.       Left            =   4950
  29.       TabIndex        =   11
  30.       Top             =   135
  31.       Width           =   3525
  32.       Begin VB.Data datDataBinding 
  33.          Caption         =   "tblMHGCHK"
  34.          Connect         =   "Access"
  35.          DatabaseName    =   ""
  36.          Exclusive       =   0   'False
  37.          Height          =   300
  38.          Left            =   90
  39.          Options         =   0
  40.          ReadOnly        =   0   'False
  41.          RecordsetType   =   1  'Dynaset
  42.          RecordSource    =   ""
  43.          Top             =   2250
  44.          Width           =   3345
  45.       End
  46.       Begin MhgchkLib.Mh3dCheck chkDataStyle 
  47.          DataSource      =   "datDataBinding"
  48.          Height          =   375
  49.          Index           =   2
  50.          Left            =   225
  51.          TabIndex        =   15
  52.          Top             =   1200
  53.          Width           =   2250
  54.          _Version        =   65536
  55.          _ExtentX        =   3958
  56.          _ExtentY        =   656
  57.          _StockProps     =   79
  58.          Caption         =   "chkDataStyle(2)"
  59.          BackColor       =   -2147483643
  60.          TintColor       =   16711935
  61.          AutoSize        =   -1  'True
  62.          BoxSize         =   13
  63.          BorderColor     =   -2147483642
  64.          FillColor       =   -2147483633
  65.          FontTransparent =   -1  'True
  66.          LightColor      =   -2147483628
  67.          PictureChecked  =   "Mhgchk_a.frx":0000
  68.          PicturePressed  =   "Mhgchk_a.frx":001C
  69.          PictureUnchecked=   "Mhgchk_a.frx":0038
  70.          PictureGrayed   =   "Mhgchk_a.frx":0054
  71.          ShadowColor     =   -2147483632
  72.          TextColor       =   -2147483630
  73.          WallPaper       =   1
  74.          Picture         =   "Mhgchk_a.frx":0070
  75.          DataChecked     =   ""
  76.          DataUnchecked   =   ""
  77.          DataGrayed      =   ""
  78.       End
  79.       Begin MhgchkLib.Mh3dCheck chkDataStyle 
  80.          DataSource      =   "datDataBinding"
  81.          Height          =   372
  82.          Index           =   0
  83.          Left            =   228
  84.          TabIndex        =   16
  85.          Top             =   672
  86.          Width           =   2244
  87.          _Version        =   65536
  88.          _ExtentX        =   3958
  89.          _ExtentY        =   656
  90.          _StockProps     =   79
  91.          Caption         =   "chkDataStyle(0)"
  92.          BackColor       =   -2147483643
  93.          TintColor       =   16711935
  94.          AutoSize        =   -1  'True
  95.          BoxSize         =   13
  96.          BorderColor     =   -2147483642
  97.          FillColor       =   -2147483633
  98.          FontTransparent =   -1  'True
  99.          LightColor      =   -2147483628
  100.          PictureChecked  =   "Mhgchk_a.frx":008C
  101.          PicturePressed  =   "Mhgchk_a.frx":00A8
  102.          PictureUnchecked=   "Mhgchk_a.frx":00C4
  103.          PictureGrayed   =   "Mhgchk_a.frx":00E0
  104.          ShadowColor     =   -2147483632
  105.          TextColor       =   -2147483630
  106.          WallPaper       =   1
  107.          Picture         =   "Mhgchk_a.frx":00FC
  108.          DataChecked     =   ""
  109.          DataUnchecked   =   ""
  110.          DataGrayed      =   ""
  111.       End
  112.       Begin VB.Label lblDataStyle 
  113.          Caption         =   "lblDataStyle(2)"
  114.          DataSource      =   "datDataBinding"
  115.          Height          =   195
  116.          Index           =   2
  117.          Left            =   2520
  118.          TabIndex        =   17
  119.          Top             =   1200
  120.          Width           =   840
  121.       End
  122.       Begin VB.Label lblDataStyle 
  123.          Caption         =   "lblDataStyle(0)"
  124.          DataSource      =   "datDataBinding"
  125.          Height          =   192
  126.          Index           =   0
  127.          Left            =   2556
  128.          TabIndex        =   18
  129.          Top             =   756
  130.          Width           =   840
  131.       End
  132.       Begin VB.Label lblValue 
  133.          Caption         =   "Value:"
  134.          Height          =   195
  135.          Left            =   2430
  136.          TabIndex        =   19
  137.          Top             =   315
  138.          Width           =   555
  139.       End
  140.       Begin VB.Line linCheck 
  141.          X1              =   225
  142.          X2              =   3285
  143.          Y1              =   585
  144.          Y2              =   585
  145.       End
  146.    End
  147.    Begin VB.Frame frmCheck 
  148.       Caption         =   "frmCheck(0)"
  149.       Height          =   3975
  150.       Index           =   0
  151.       Left            =   135
  152.       TabIndex        =   0
  153.       Top             =   135
  154.       Width           =   4695
  155.       Begin VB.OptionButton optFontStyle 
  156.          Caption         =   "optFontStyle(4)"
  157.          Enabled         =   0   'False
  158.          Height          =   420
  159.          Index           =   4
  160.          Left            =   2520
  161.          TabIndex        =   10
  162.          Top             =   3330
  163.          Width           =   1680
  164.       End
  165.       Begin VB.OptionButton optFontStyle 
  166.          Caption         =   "optFontStyle(3)"
  167.          Enabled         =   0   'False
  168.          Height          =   240
  169.          Index           =   3
  170.          Left            =   2520
  171.          TabIndex        =   9
  172.          Top             =   3060
  173.          Width           =   1725
  174.       End
  175.       Begin VB.OptionButton optFontStyle 
  176.          Caption         =   "optFontStyle(2)"
  177.          Enabled         =   0   'False
  178.          Height          =   420
  179.          Index           =   2
  180.          Left            =   720
  181.          TabIndex        =   8
  182.          Top             =   3330
  183.          Width           =   1680
  184.       End
  185.       Begin VB.OptionButton optFontStyle 
  186.          Caption         =   "optFontStyle(1)"
  187.          Enabled         =   0   'False
  188.          Height          =   240
  189.          Index           =   1
  190.          Left            =   720
  191.          TabIndex        =   7
  192.          Top             =   3060
  193.          Width           =   1455
  194.       End
  195.       Begin MhgchkLib.Mh3dCheck chkGraphics 
  196.          Height          =   735
  197.          Index           =   2
  198.          Left            =   270
  199.          TabIndex        =   6
  200.          Top             =   2295
  201.          Width           =   4245
  202.          _Version        =   65536
  203.          _ExtentX        =   7488
  204.          _ExtentY        =   1296
  205.          _StockProps     =   79
  206.          Caption         =   "chkGraphics(2)"
  207.          BackColor       =   -2147483643
  208.          TintColor       =   16711935
  209.          AutoSize        =   -1  'True
  210.          BoxSize         =   20
  211.          BorderColor     =   -2147483642
  212.          FillColor       =   -2147483633
  213.          FontTransparent =   -1  'True
  214.          LightColor      =   -2147483628
  215.          Multiline       =   -1  'True
  216.          PictureChecked  =   "Mhgchk_a.frx":0118
  217.          PicturePressed  =   "Mhgchk_a.frx":029A
  218.          PictureUnchecked=   "Mhgchk_a.frx":041C
  219.          PictureGrayed   =   "Mhgchk_a.frx":059E
  220.          ShadowColor     =   -2147483632
  221.          TextColor       =   -2147483630
  222.          WallPaper       =   1
  223.          Picture         =   "Mhgchk_a.frx":05BA
  224.          DataChecked     =   ""
  225.          DataUnchecked   =   ""
  226.          DataGrayed      =   ""
  227.       End
  228.       Begin MhgchkLib.Mh3dCheck chkGraphics 
  229.          Height          =   735
  230.          Index           =   0
  231.          Left            =   270
  232.          TabIndex        =   1
  233.          Top             =   360
  234.          Width           =   4245
  235.          _Version        =   65536
  236.          _ExtentX        =   7488
  237.          _ExtentY        =   1296
  238.          _StockProps     =   79
  239.          Caption         =   "chkGraphics(0)"
  240.          BackColor       =   -2147483643
  241.          TintColor       =   16711935
  242.          AutoSize        =   -1  'True
  243.          BoxSize         =   20
  244.          BorderColor     =   -2147483642
  245.          FillColor       =   -2147483633
  246.          FontTransparent =   -1  'True
  247.          LightColor      =   -2147483628
  248.          Multiline       =   -1  'True
  249.          PictureChecked  =   "Mhgchk_a.frx":05D6
  250.          PicturePressed  =   "Mhgchk_a.frx":0758
  251.          PictureUnchecked=   "Mhgchk_a.frx":08DA
  252.          PictureGrayed   =   "Mhgchk_a.frx":0A5C
  253.          ShadowColor     =   -2147483632
  254.          TextColor       =   -2147483630
  255.          WallPaper       =   1
  256.          Picture         =   "Mhgchk_a.frx":0A78
  257.          DataChecked     =   ""
  258.          DataUnchecked   =   ""
  259.          DataGrayed      =   ""
  260.       End
  261.       Begin MhgchkLib.Mh3dCheck chkStooge 
  262.          Height          =   390
  263.          Index           =   0
  264.          Left            =   720
  265.          TabIndex        =   2
  266.          Top             =   1125
  267.          Width           =   885
  268.          _Version        =   65536
  269.          _ExtentX        =   1561
  270.          _ExtentY        =   688
  271.          _StockProps     =   79
  272.          Caption         =   "chkStooge(0)"
  273.          BackColor       =   -2147483643
  274.          Enabled         =   0   'False
  275.          TintColor       =   16711935
  276.          BoxSize         =   17
  277.          BorderColor     =   -2147483642
  278.          FillColor       =   -2147483633
  279.          FontTransparent =   -1  'True
  280.          LightColor      =   -2147483628
  281.          PictureChecked  =   "Mhgchk_a.frx":0A94
  282.          PicturePressed  =   "Mhgchk_a.frx":103A
  283.          PictureUnchecked=   "Mhgchk_a.frx":15E0
  284.          PictureGrayed   =   "Mhgchk_a.frx":1B86
  285.          ShadowColor     =   -2147483632
  286.          TextColor       =   -2147483630
  287.          WallPaper       =   1
  288.          Value           =   2
  289.          Picture         =   "Mhgchk_a.frx":212C
  290.          DataChecked     =   ""
  291.          DataUnchecked   =   ""
  292.          DataGrayed      =   ""
  293.       End
  294.       Begin MhgchkLib.Mh3dCheck chkStooge 
  295.          Height          =   390
  296.          Index           =   1
  297.          Left            =   1665
  298.          TabIndex        =   3
  299.          Top             =   1125
  300.          Width           =   885
  301.          _Version        =   65536
  302.          _ExtentX        =   1561
  303.          _ExtentY        =   688
  304.          _StockProps     =   79
  305.          Caption         =   "chkStooge(1)"
  306.          BackColor       =   -2147483643
  307.          Enabled         =   0   'False
  308.          TintColor       =   16711935
  309.          BoxSize         =   17
  310.          BorderColor     =   -2147483642
  311.          FillColor       =   -2147483633
  312.          FontTransparent =   -1  'True
  313.          LightColor      =   -2147483628
  314.          PictureChecked  =   "Mhgchk_a.frx":2148
  315.          PicturePressed  =   "Mhgchk_a.frx":26EE
  316.          PictureUnchecked=   "Mhgchk_a.frx":2C94
  317.          PictureGrayed   =   "Mhgchk_a.frx":323A
  318.          ShadowColor     =   -2147483632
  319.          TextColor       =   -2147483630
  320.          WallPaper       =   1
  321.          Value           =   2
  322.          Picture         =   "Mhgchk_a.frx":37E0
  323.          DataChecked     =   ""
  324.          DataUnchecked   =   ""
  325.          DataGrayed      =   ""
  326.       End
  327.       Begin MhgchkLib.Mh3dCheck chkStooge 
  328.          Height          =   390
  329.          Index           =   2
  330.          Left            =   2610
  331.          TabIndex        =   4
  332.          Top             =   1125
  333.          Width           =   885
  334.          _Version        =   65536
  335.          _ExtentX        =   1561
  336.          _ExtentY        =   688
  337.          _StockProps     =   79
  338.          Caption         =   "chkStooge(2)"
  339.          BackColor       =   -2147483643
  340.          Enabled         =   0   'False
  341.          TintColor       =   16711935
  342.          BoxSize         =   17
  343.          BorderColor     =   -2147483642
  344.          FillColor       =   -2147483633
  345.          FontTransparent =   -1  'True
  346.          LightColor      =   -2147483628
  347.          PictureChecked  =   "Mhgchk_a.frx":37FC
  348.          PicturePressed  =   "Mhgchk_a.frx":3DA2
  349.          PictureUnchecked=   "Mhgchk_a.frx":4348
  350.          PictureGrayed   =   "Mhgchk_a.frx":48EE
  351.          ShadowColor     =   -2147483632
  352.          TextColor       =   -2147483630
  353.          WallPaper       =   1
  354.          Value           =   2
  355.          Picture         =   "Mhgchk_a.frx":4E94
  356.          DataChecked     =   ""
  357.          DataUnchecked   =   ""
  358.          DataGrayed      =   ""
  359.       End
  360.       Begin MhgchkLib.Mh3dCheck chkGraphics 
  361.          Height          =   735
  362.          Index           =   1
  363.          Left            =   270
  364.          TabIndex        =   5
  365.          Top             =   1575
  366.          Width           =   4245
  367.          _Version        =   65536
  368.          _ExtentX        =   7488
  369.          _ExtentY        =   1296
  370.          _StockProps     =   79
  371.          Caption         =   "chkGraphics(1)"
  372.          BackColor       =   -2147483643
  373.          TintColor       =   16711935
  374.          AutoSize        =   -1  'True
  375.          BoxSize         =   20
  376.          BorderColor     =   -2147483642
  377.          FillColor       =   -2147483633
  378.          FontTransparent =   -1  'True
  379.          LightColor      =   -2147483628
  380.          Multiline       =   -1  'True
  381.          PictureChecked  =   "Mhgchk_a.frx":4EB0
  382.          PicturePressed  =   "Mhgchk_a.frx":5032
  383.          PictureUnchecked=   "Mhgchk_a.frx":51B4
  384.          PictureGrayed   =   "Mhgchk_a.frx":5336
  385.          ShadowColor     =   -2147483632
  386.          TextColor       =   -2147483630
  387.          WallPaper       =   1
  388.          Picture         =   "Mhgchk_a.frx":5352
  389.          DataChecked     =   ""
  390.          DataUnchecked   =   ""
  391.          DataGrayed      =   ""
  392.       End
  393.    End
  394.    Begin MhgchkLib.Mh3dCheck chkMark 
  395.       Height          =   510
  396.       Left            =   4950
  397.       TabIndex        =   13
  398.       Top             =   2925
  399.       Width           =   1455
  400.       _Version        =   65536
  401.       _ExtentX        =   2566
  402.       _ExtentY        =   900
  403.       _StockProps     =   79
  404.       Caption         =   "chkMark"
  405.       BackColor       =   -2147483643
  406.       TintColor       =   16711935
  407.       AutoSize        =   -1  'True
  408.       BoxSize         =   13
  409.       BorderColor     =   -2147483642
  410.       FillColor       =   -2147483633
  411.       FontTransparent =   -1  'True
  412.       LightColor      =   -2147483628
  413.       Multiline       =   -1  'True
  414.       PictureChecked  =   "Mhgchk_a.frx":536E
  415.       PicturePressed  =   "Mhgchk_a.frx":538A
  416.       PictureUnchecked=   "Mhgchk_a.frx":53A6
  417.       PictureGrayed   =   "Mhgchk_a.frx":53C2
  418.       ShadowColor     =   -2147483632
  419.       TextColor       =   -2147483630
  420.       WallPaper       =   1
  421.       Picture         =   "Mhgchk_a.frx":53DE
  422.       DataChecked     =   ""
  423.       DataUnchecked   =   ""
  424.       DataGrayed      =   ""
  425.    End
  426.    Begin MhgchkLib.Mh3dCheck chkID 
  427.       Height          =   735
  428.       Left            =   5220
  429.       TabIndex        =   12
  430.       Top             =   3465
  431.       Width           =   870
  432.       _Version        =   65536
  433.       _ExtentX        =   1535
  434.       _ExtentY        =   1296
  435.       _StockProps     =   79
  436.       BackColor       =   -2147483643
  437.       Enabled         =   0   'False
  438.       TintColor       =   16711935
  439.       AutoSize        =   -1  'True
  440.       BoxSize         =   50
  441.       BorderColor     =   -2147483642
  442.       FillColor       =   -2147483633
  443.       FontTransparent =   -1  'True
  444.       LightColor      =   -2147483628
  445.       Multiline       =   -1  'True
  446.       PictureChecked  =   "Mhgchk_a.frx":53FA
  447.       PicturePressed  =   "Mhgchk_a.frx":58EC
  448.       PictureUnchecked=   "Mhgchk_a.frx":5DDE
  449.       PictureGrayed   =   "Mhgchk_a.frx":62D0
  450.       ShadowColor     =   -2147483632
  451.       TextColor       =   -2147483630
  452.       WallPaper       =   1
  453.       Value           =   2
  454.       Picture         =   "Mhgchk_a.frx":67C2
  455.       DataChecked     =   ""
  456.       DataUnchecked   =   ""
  457.       DataGrayed      =   ""
  458.    End
  459. Attribute VB_Name = "fMain"
  460. Attribute VB_Creatable = False
  461. Attribute VB_Exposed = False
  462. Option Explicit
  463. Const iStooge = 0
  464. Const iMultiLine = 1
  465. Const iFontStyle = 2
  466. Private Sub chkGraphics_Click(Index As Integer)
  467. Dim iCount As Integer
  468. Dim sCaption As String
  469.     Select Case Index
  470.         ' Enable/disable .MultiLine property
  471.         ' and display different caption.
  472.         Case iMultiLine
  473.             chkGraphics(iMultiLine).MultiLine = Not chkGraphics(iMultiLine).MultiLine
  474.             If chkGraphics(iMultiLine).MultiLine Then
  475.                 sCaption = "When offering important selections, "
  476.                 sCaption = sCaption & "you may want to include more text "
  477.                 sCaption = sCaption & "than can fit on a single line.  "
  478.                 sCaption = sCaption & "Use the .MultiLine property to accomplish this."
  479.             Else
  480.                 sCaption = "Often, single-line captions just aren't long enough."
  481.             End If
  482.             chkGraphics(iMultiLine).Caption = sCaption
  483.         
  484.         ' Enable/disable 3 Stooges check boxes
  485.         ' and set the initial value.
  486.         Case iStooge
  487.             For iCount = 0 To 2
  488.                 chkStooge(iCount).Enabled = (chkGraphics(iStooge).Value = 1)
  489.                 chkStooge(iCount).Value = IIf(chkStooge(iCount).Enabled, 0, 2)
  490.             Next iCount
  491.         
  492.         ' Enable/disable .FontStyle option buttons.
  493.         ' Use .FontStyle = 0 when disabled.
  494.         Case iFontStyle
  495.             For iCount = 1 To 4
  496.                 optFontStyle(iCount).Enabled = (chkGraphics(iFontStyle).Value = 1)
  497.                 optFontStyle(iCount).Value = False
  498.             Next iCount
  499.             If chkGraphics(iFontStyle).Value = 1 Then
  500.                 optFontStyle(1).Value = True
  501.             Else
  502.                 chkGraphics(iFontStyle).FontStyle = 0
  503.             End If
  504.     End Select
  505. End Sub
  506. Private Sub chkMark_Click()
  507.     ' Enable/disable ID check boxes
  508.     ' and set the initial value.
  509.     chkID.Enabled = (chkMark.Value = 1)
  510.     chkID.Value = IIf(chkID.Enabled, 0, 2)
  511. End Sub
  512. Private Sub cmdAction_Click()
  513.     Unload Me
  514. End Sub
  515. Private Sub Form_Load()
  516. Dim sDBFullPath As String
  517.     ' Get location of TOOLS database.
  518.     sDBFullPath = App.Path
  519.     If Right(sDBFullPath, 1) <> "\" Then sDBFullPath = sDBFullPath & "\"
  520.     sDBFullPath = sDBFullPath & "..\tools.mdb"
  521.     ' if the file is not in the default location then have the user supply the path
  522.     If InStr(LCase$(Dir$(sDBFullPath)), "tools.mdb") = 0 Then sDBFullPath = InputBox("Enter the path for the file TOOLS.MDB:", "MicroHelp OLETools 5", sDBFullPath)
  523.     ' Set properties for data control.
  524.     datDataBinding.DatabaseName = sDBFullPath
  525.     datDataBinding.RecordSource = "tblMHGCHK"
  526.      ' Set properties for check boxes.
  527.     chkDataStyle(0).DataField = "fDataStyle0"
  528.     chkDataStyle(0).DataStyle = 1 ' text
  529.     chkDataStyle(2).DataField = "bytDataStyle2"
  530.     lblDataStyle(0).DataField = "fDataStyle0"
  531.     lblDataStyle(2).DataField = "bytDataStyle2"
  532.     ' Set .Caption for each control.
  533.     frmCheck(0).Caption = "Graphics Options"
  534.     frmCheck(1).Caption = "Data Binding Options"
  535.     chkGraphics(0).Caption = "Change the appearance of the check box by setting the various .&Picture* properties.  You can change the Checked, Unchecked, Pressed, and Grayed images:"
  536.     chkGraphics(1).Caption = "When offering important selections, you may want to include more text than can fit on a single line.  Use the .MultiLine property to accomplish this."
  537.     chkGraphics(2).Caption = "Text can be displayed in different &styles: normal, raised, or lowered (with two levels of shading for raised and lowered)."
  538.     optFontStyle(1).Caption = "1 - Raised"
  539.     optFontStyle(2).Caption = "2 - Raised with More Shading"
  540.     optFontStyle(3).Caption = "3 - Lowered"
  541.     optFontStyle(4).Caption = "4 - Lowered with More Shading"
  542.     chkStooge(0).Caption = "&Moe"
  543.     chkStooge(1).Caption = "&Larry"
  544.     chkStooge(2).Caption = "&Curly"
  545.     chkDataStyle(0).Caption = "(Boolean)"
  546.     chkDataStyle(2).Caption = "(Numeric)"
  547.     chkMark.Caption = "Leave your mark here:"
  548.     ' center form to screen
  549.     Move Abs(Screen.Width - Width) \ 2, Abs(Screen.Height - Height) \ 2
  550. End Sub
  551. Private Sub optFontStyle_Click(Index As Integer)
  552.     ' Change .FontStyle property of the checkbox.
  553.     If optFontStyle(Index).Value Then chkGraphics(iFontStyle).FontStyle = Index
  554. End Sub
  555.