home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhopt / mhgopt_a.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-11-30  |  15.5 KB  |  418 lines

  1. VERSION 4.00
  2. Begin VB.Form fMain 
  3.    Caption         =   "MicroHelp VBTools 5 - Mh3dOption Example"
  4.    ClientHeight    =   4275
  5.    ClientLeft      =   1725
  6.    ClientTop       =   2160
  7.    ClientWidth     =   8640
  8.    Height          =   4680
  9.    Left            =   1665
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    ScaleHeight     =   4275
  13.    ScaleWidth      =   8640
  14.    Top             =   1815
  15.    Width           =   8760
  16.    Begin VB.PictureBox picWallPaper 
  17.       Height          =   600
  18.       Left            =   4950
  19.       Picture         =   "mhgopt_a.frx":0000
  20.       ScaleHeight     =   540
  21.       ScaleWidth      =   675
  22.       TabIndex        =   16
  23.       Top             =   2970
  24.       Visible         =   0   'False
  25.       Width           =   735
  26.    End
  27.    Begin VB.CommandButton cmdAction 
  28.       Caption         =   "E&xit"
  29.       Height          =   510
  30.       Left            =   6885
  31.       TabIndex        =   6
  32.       Top             =   3600
  33.       Width           =   1590
  34.    End
  35.    Begin VB.Frame frmOption 
  36.       Caption         =   "frmOption(1)"
  37.       Height          =   1800
  38.       Index           =   1
  39.       Left            =   4950
  40.       TabIndex        =   5
  41.       Top             =   135
  42.       Width           =   3525
  43.       Begin VB.Data datDataBinding 
  44.          Caption         =   "tblMHGOPT"
  45.          Connect         =   "Access"
  46.          DatabaseName    =   ""
  47.          Exclusive       =   0   'False
  48.          Height          =   300
  49.          Left            =   90
  50.          Options         =   0
  51.          ReadOnly        =   0   'False
  52.          RecordsetType   =   1  'Dynaset
  53.          RecordSource    =   ""
  54.          Top             =   1365
  55.          Width           =   3345
  56.       End
  57.       Begin VB.Label lblRecord 
  58.          Alignment       =   1  'Right Justify
  59.          Caption         =   "lblRecord"
  60.          BeginProperty Font 
  61.             name            =   "Courier New"
  62.             charset         =   0
  63.             weight          =   400
  64.             size            =   8.25
  65.             underline       =   0   'False
  66.             italic          =   0   'False
  67.             strikethrough   =   0   'False
  68.          EndProperty
  69.          Height          =   195
  70.          Left            =   90
  71.          TabIndex        =   17
  72.          Top             =   1140
  73.          Width           =   3300
  74.       End
  75.       Begin Mh3doptLib.Mh3dOption optDataStyle 
  76.          DataSource      =   "datDataBinding"
  77.          Height          =   375
  78.          Index           =   0
  79.          Left            =   225
  80.          TabIndex        =   9
  81.          Top             =   675
  82.          Width           =   2175
  83.          _Version        =   65536
  84.          _ExtentX        =   3836
  85.          _ExtentY        =   661
  86.          _StockProps     =   79
  87.          Caption         =   "optDataStyle(0)"
  88.          TintColor       =   16711935
  89.          AutoSize        =   -1  'True
  90.          BoxSize         =   13
  91.          BorderColor     =   -2147483642
  92.          FillColor       =   -2147483633
  93.          FontTransparent =   -1  'True
  94.          LightColor      =   -2147483628
  95.          PictureChecked  =   "mhgopt_a.frx":0596
  96.          PicturePressed  =   "mhgopt_a.frx":05B2
  97.          PictureUnChecked=   "mhgopt_a.frx":05CE
  98.          PictureGrayed   =   "mhgopt_a.frx":05EA
  99.          ShadowColor     =   -2147483632
  100.          TextColor       =   -2147483630
  101.          WallPaper       =   1
  102.          Picture         =   "mhgopt_a.frx":0606
  103.          DataText        =   ""
  104.       End
  105.       Begin VB.Label lblDataStyle 
  106.          Caption         =   "lblDataStyle(0)"
  107.          DataSource      =   "datDataBinding"
  108.          Height          =   195
  109.          Index           =   0
  110.          Left            =   2430
  111.          TabIndex        =   7
  112.          Top             =   765
  113.          Width           =   915
  114.       End
  115.       Begin VB.Label lblValue 
  116.          Caption         =   "Value:"
  117.          Height          =   195
  118.          Left            =   2430
  119.          TabIndex        =   8
  120.          Top             =   315
  121.          Width           =   555
  122.       End
  123.       Begin VB.Line linCheck 
  124.          X1              =   225
  125.          X2              =   3285
  126.          Y1              =   585
  127.          Y2              =   585
  128.       End
  129.    End
  130.    Begin VB.Frame frmOption 
  131.       Caption         =   "frmOption(0)"
  132.       Height          =   3975
  133.       Index           =   0
  134.       Left            =   135
  135.       TabIndex        =   0
  136.       Top             =   135
  137.       Width           =   4695
  138.       Begin VB.OptionButton optWallPaper 
  139.          Caption         =   "optWallPaper(2)"
  140.          Height          =   285
  141.          Index           =   2
  142.          Left            =   3150
  143.          TabIndex        =   15
  144.          Top             =   1125
  145.          Width           =   1275
  146.       End
  147.       Begin VB.OptionButton optWallPaper 
  148.          Caption         =   "optWallPaper(1)"
  149.          Height          =   285
  150.          Index           =   1
  151.          Left            =   1800
  152.          TabIndex        =   14
  153.          Top             =   1125
  154.          Width           =   1275
  155.       End
  156.       Begin VB.OptionButton optWallPaper 
  157.          Caption         =   "optWallPaper(0)"
  158.          Height          =   285
  159.          Index           =   0
  160.          Left            =   450
  161.          TabIndex        =   13
  162.          Top             =   1125
  163.          Value           =   -1  'True
  164.          Width           =   1275
  165.       End
  166.       Begin VB.OptionButton optFontStyle 
  167.          Caption         =   "optFontStyle(4)"
  168.          Enabled         =   0   'False
  169.          Height          =   420
  170.          Index           =   4
  171.          Left            =   2520
  172.          TabIndex        =   4
  173.          Top             =   3330
  174.          Width           =   1680
  175.       End
  176.       Begin VB.OptionButton optFontStyle 
  177.          Caption         =   "optFontStyle(3)"
  178.          Enabled         =   0   'False
  179.          Height          =   240
  180.          Index           =   3
  181.          Left            =   2520
  182.          TabIndex        =   3
  183.          Top             =   3060
  184.          Width           =   1725
  185.       End
  186.       Begin VB.OptionButton optFontStyle 
  187.          Caption         =   "optFontStyle(2)"
  188.          Enabled         =   0   'False
  189.          Height          =   420
  190.          Index           =   2
  191.          Left            =   720
  192.          TabIndex        =   2
  193.          Top             =   3330
  194.          Width           =   1680
  195.       End
  196.       Begin VB.OptionButton optFontStyle 
  197.          Caption         =   "optFontStyle(1)"
  198.          Enabled         =   0   'False
  199.          Height          =   240
  200.          Index           =   1
  201.          Left            =   720
  202.          TabIndex        =   1
  203.          Top             =   3060
  204.          Width           =   1455
  205.       End
  206.       Begin Mh3doptLib.Mh3dOption optGraphics 
  207.          Height          =   750
  208.          Index           =   2
  209.          Left            =   225
  210.          TabIndex        =   12
  211.          Top             =   2250
  212.          Width           =   4260
  213.          _Version        =   65536
  214.          _ExtentX        =   7514
  215.          _ExtentY        =   1323
  216.          _StockProps     =   79
  217.          Caption         =   "optGraphics(2)"
  218.          TintColor       =   16711935
  219.          BoxSize         =   17
  220.          BorderColor     =   -2147483642
  221.          FillColor       =   -2147483633
  222.          FontTransparent =   -1  'True
  223.          LightColor      =   -2147483628
  224.          Multiline       =   -1  'True
  225.          PictureChecked  =   "mhgopt_a.frx":0622
  226.          PicturePressed  =   "mhgopt_a.frx":063E
  227.          PictureUnChecked=   "mhgopt_a.frx":065A
  228.          PictureGrayed   =   "mhgopt_a.frx":0676
  229.          ShadowColor     =   -2147483632
  230.          TextColor       =   -2147483630
  231.          WallPaper       =   1
  232.          Picture         =   "mhgopt_a.frx":0692
  233.          Group           =   1
  234.          DataText        =   ""
  235.       End
  236.       Begin Mh3doptLib.Mh3dOption optGraphics 
  237.          Height          =   750
  238.          Index           =   1
  239.          Left            =   225
  240.          TabIndex        =   11
  241.          Top             =   1440
  242.          Width           =   4260
  243.          _Version        =   65536
  244.          _ExtentX        =   7514
  245.          _ExtentY        =   1323
  246.          _StockProps     =   79
  247.          Caption         =   "optGraphics(1)"
  248.          TintColor       =   16711935
  249.          BoxSize         =   17
  250.          BorderColor     =   -2147483642
  251.          FillColor       =   -2147483633
  252.          FontTransparent =   -1  'True
  253.          LightColor      =   -2147483628
  254.          Multiline       =   -1  'True
  255.          PictureChecked  =   "mhgopt_a.frx":06AE
  256.          PicturePressed  =   "mhgopt_a.frx":06CA
  257.          PictureUnChecked=   "mhgopt_a.frx":06E6
  258.          PictureGrayed   =   "mhgopt_a.frx":0702
  259.          ShadowColor     =   -2147483632
  260.          TextColor       =   -2147483630
  261.          WallPaper       =   1
  262.          Picture         =   "mhgopt_a.frx":071E
  263.          Group           =   1
  264.          DataText        =   ""
  265.       End
  266.       Begin Mh3doptLib.Mh3dOption optGraphics 
  267.          Height          =   750
  268.          Index           =   0
  269.          Left            =   225
  270.          TabIndex        =   10
  271.          Top             =   315
  272.          Width           =   4260
  273.          _Version        =   65536
  274.          _ExtentX        =   7514
  275.          _ExtentY        =   1323
  276.          _StockProps     =   79
  277.          Caption         =   "optGraphics(0)"
  278.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  279.             name            =   "MS Sans Serif"
  280.             charset         =   0
  281.             weight          =   700
  282.             size            =   8.25
  283.             underline       =   0   'False
  284.             italic          =   0   'False
  285.             strikethrough   =   0   'False
  286.          EndProperty
  287.          TintColor       =   16711935
  288.          BoxSize         =   17
  289.          BorderColor     =   -2147483642
  290.          FillColor       =   -2147483633
  291.          FontTransparent =   -1  'True
  292.          LightColor      =   -2147483628
  293.          Multiline       =   -1  'True
  294.          PictureChecked  =   "mhgopt_a.frx":073A
  295.          PicturePressed  =   "mhgopt_a.frx":0756
  296.          PictureUnChecked=   "mhgopt_a.frx":0772
  297.          PictureGrayed   =   "mhgopt_a.frx":078E
  298.          ShadowColor     =   -2147483632
  299.          TextColor       =   -2147483630
  300.          Picture         =   "mhgopt_a.frx":07AA
  301.          Value           =   -1
  302.          Group           =   1
  303.          DataText        =   ""
  304.       End
  305.    End
  306. Attribute VB_Name = "fMain"
  307. Attribute VB_Creatable = False
  308. Attribute VB_Exposed = False
  309. Option Explicit
  310. Const iWallPaper = 0
  311. Const iMultiLine = 1
  312. Const iFontStyle = 2
  313. Private Sub optGraphics_Click(Index As Integer)
  314. Dim iCount As Integer
  315. Dim sCaption As String
  316.     ' Reset option values.
  317.     For iCount = 0 To 2
  318.         optGraphics(iCount).Value = 0
  319.     Next iCount
  320.     optGraphics(Index).Value = 1
  321.     ' Clear out wallpaper image and disable options.
  322.     If Index <> iWallPaper Then
  323.         optGraphics(iWallPaper).Picture = LoadPicture("")
  324.         optGraphics(iWallPaper).FontBold = False
  325.         optWallPaper(0).Enabled = False
  326.         optWallPaper(1).Enabled = False
  327.         optWallPaper(2).Enabled = False
  328.     End If
  329.     ' Reset to not multiline.
  330.     If Index <> iMultiLine Then
  331.         optGraphics(iMultiLine).MultiLine = False
  332.         optGraphics(iMultiLine).Caption = "Often, single-line captions just aren't long enough."
  333.     End If
  334.         
  335.     ' Use standard font style.
  336.     If Index <> iFontStyle Then
  337.         For iCount = 1 To 4
  338.             optFontStyle(iCount).Enabled = False
  339.             optFontStyle(iCount).Value = False
  340.         Next iCount
  341.         optGraphics(iFontStyle).FontStyle = 0
  342.     End If
  343.     Select Case Index
  344.         ' Enable/disable wallpaper.
  345.         ' and set the initial value.
  346.         Case iWallPaper
  347.             optGraphics(iWallPaper).FontBold = True
  348.             optWallPaper(0).Enabled = True
  349.             optWallPaper(1).Enabled = True
  350.             optWallPaper(2).Enabled = True
  351.             optGraphics(iWallPaper).Picture = picWallPaper.Picture
  352.             optGraphics(iWallPaper).WallPaper = 0
  353.             optWallPaper(0).Value = True
  354.             
  355.         ' Enable/disable .MultiLine property
  356.         ' and display different caption.
  357.         Case iMultiLine
  358.             optGraphics(iMultiLine).MultiLine = True
  359.             sCaption = "When offering important selections, "
  360.             sCaption = sCaption & "you may want to include more text "
  361.             sCaption = sCaption & "than can fit on a single line.  "
  362.             sCaption = sCaption & "Use the .MultiLine property to accomplish this."
  363.             optGraphics(iMultiLine).Caption = sCaption
  364.         
  365.         ' Enable/disable .FontStyle option buttons.
  366.         ' Use .FontStyle = 0 when disabled.
  367.         Case iFontStyle
  368.             For iCount = 1 To 4
  369.                 optFontStyle(iCount).Enabled = True
  370.             Next iCount
  371.             optFontStyle(1).Value = True
  372.     End Select
  373. End Sub
  374. Private Sub cmdAction_Click()
  375.     Unload Me
  376. End Sub
  377. Private Sub Form_Load()
  378. Dim sDBFullPath As String
  379.     ' Get location of VBTOOLS database.
  380.     sDBFullPath = App.Path
  381.     If Right(sDBFullPath, 1) <> "\" Then sDBFullPath = sDBFullPath & "\"
  382.     sDBFullPath = sDBFullPath & "..\tools.mdb"
  383.     ' if the file is not in the default location then have the user supply the path
  384.     If InStr(LCase$(Dir$(sDBFullPath)), "tools.mdb") = 0 Then sDBFullPath = InputBox("Enter the path for the file TOOLS.MDB:", "MicroHelp OLETools 5", sDBFullPath)
  385.     ' Set properties for data control.
  386.     datDataBinding.DatabaseName = sDBFullPath
  387.     datDataBinding.RecordSource = "tblMHGOPT"
  388.     ' Set properties for option buttons.
  389.     lblRecord.DataField = "sRecord"
  390.     optDataStyle(0).DataField = "fDataStyle0"
  391.     lblDataStyle(0).DataField = "fDataStyle0"
  392.     ' Set .Caption for each control.
  393.     frmOption(0).Caption = "Graphics Options"
  394.     optGraphics(0).Caption = "Change the appearance of the option button by setting the .Picture property.  This allows you to display an image in the background."
  395.     optGraphics(0).Picture = picWallPaper.Picture
  396.     optGraphics(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."
  397.     optGraphics(2).Caption = "Text can be displayed in different &styles: normal, raised, or lowered (with two levels of shading for raised and lowered)."
  398.     optWallPaper(0).Caption = "0 - StrBlt"
  399.     optWallPaper(1).Caption = "1 - BitBlt"
  400.     optWallPaper(2).Caption = "2 - Replicate"
  401.     optFontStyle(1).Caption = "1 - Raised"
  402.     optFontStyle(2).Caption = "2 - Raised with More Shading"
  403.     optFontStyle(3).Caption = "3 - Lowered"
  404.     optFontStyle(4).Caption = "4 - Lowered with More Shading"
  405.     optDataStyle(0).Caption = "Boolean"
  406.     lblDataStyle(0).Caption = ""
  407.     ' center form to screen
  408.     Move Abs(Screen.Width - Width) \ 2, Abs(Screen.Height - Height) \ 2
  409. End Sub
  410. Private Sub optFontStyle_Click(Index As Integer)
  411.     ' Change .FontStyle property of the checkbox.
  412.     If optFontStyle(Index).Value Then optGraphics(iFontStyle).FontStyle = Index
  413. End Sub
  414. Private Sub optWallPaper_Click(Index As Integer)
  415.     ' Change the wallpaper property accordingly.
  416.     optGraphics(0).WallPaper = Index
  417. End Sub
  418.