home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhgrp / mh3dgrp.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-05-09  |  19.7 KB  |  609 lines

  1. VERSION 4.00
  2. Begin VB.Form mhgroup 
  3.    Caption         =   "Mh3dGroup Sample program"
  4.    ClientHeight    =   5235
  5.    ClientLeft      =   1290
  6.    ClientTop       =   1530
  7.    ClientWidth     =   6045
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   0
  11.       weight          =   700
  12.       size            =   8.25
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    ForeColor       =   &H80000008&
  18.    Height          =   5640
  19.    Left            =   1230
  20.    LinkMode        =   1  'Source
  21.    LinkTopic       =   "Form1"
  22.    ScaleHeight     =   5235
  23.    ScaleWidth      =   6045
  24.    Top             =   1185
  25.    Width           =   6165
  26.    Begin VB.PictureBox Picture1 
  27.       Appearance      =   0  'Flat
  28.       BackColor       =   &H80000005&
  29.       ForeColor       =   &H80000008&
  30.       Height          =   255
  31.       Left            =   360
  32.       ScaleHeight     =   225
  33.       ScaleWidth      =   465
  34.       TabIndex        =   10
  35.       Top             =   7080
  36.       Visible         =   0   'False
  37.       Width           =   495
  38.    End
  39.    Begin VB.CommandButton Command2 
  40.       Appearance      =   0  'Flat
  41.       BackColor       =   &H80000005&
  42.       Caption         =   "Ok"
  43.       Height          =   375
  44.       Left            =   4800
  45.       TabIndex        =   14
  46.       Top             =   4680
  47.       Width           =   855
  48.    End
  49.    Begin VB.Frame Frame4 
  50.       Caption         =   "Assign Groups"
  51.       Height          =   1815
  52.       Left            =   2520
  53.       TabIndex        =   23
  54.       Top             =   3240
  55.       Width           =   1935
  56.       Begin VB.Label Label4 
  57.          Alignment       =   2  'Center
  58.          Appearance      =   0  'Flat
  59.          BackColor       =   &H00808080&
  60.          Caption         =   "2"
  61.          DragIcon        =   "mh3dgrp.frx":0000
  62.          ForeColor       =   &H80000008&
  63.          Height          =   255
  64.          Index           =   2
  65.          Left            =   1320
  66.          TabIndex        =   28
  67.          Top             =   1320
  68.          Width           =   495
  69.       End
  70.       Begin VB.Label Label4 
  71.          Alignment       =   2  'Center
  72.          Appearance      =   0  'Flat
  73.          BackColor       =   &H00808080&
  74.          Caption         =   "1"
  75.          DragIcon        =   "mh3dgrp.frx":030A
  76.          ForeColor       =   &H80000008&
  77.          Height          =   255
  78.          Index           =   1
  79.          Left            =   720
  80.          TabIndex        =   27
  81.          Top             =   1320
  82.          Width           =   495
  83.       End
  84.       Begin VB.Label Label4 
  85.          Alignment       =   2  'Center
  86.          Appearance      =   0  'Flat
  87.          BackColor       =   &H00808080&
  88.          Caption         =   "0"
  89.          DragIcon        =   "mh3dgrp.frx":0614
  90.          ForeColor       =   &H80000008&
  91.          Height          =   255
  92.          Index           =   0
  93.          Left            =   120
  94.          TabIndex        =   26
  95.          Top             =   1320
  96.          Width           =   495
  97.       End
  98.       Begin VB.Label Label3 
  99.          Alignment       =   2  'Center
  100.          Caption         =   "Click and hold mouse on group # and drag to button to assign group."
  101.          Height          =   855
  102.          Left            =   120
  103.          TabIndex        =   25
  104.          Top             =   360
  105.          Width           =   1695
  106.       End
  107.    End
  108.    Begin VB.Frame Frame3 
  109.       Caption         =   "Border Styles"
  110.       Height          =   1815
  111.       Left            =   240
  112.       TabIndex        =   11
  113.       Top             =   3240
  114.       Width           =   1815
  115.       Begin VB.HScrollBar HScroll1 
  116.          Height          =   255
  117.          LargeChange     =   2
  118.          Left            =   120
  119.          Max             =   10
  120.          TabIndex        =   12
  121.          Top             =   1320
  122.          Value           =   2
  123.          Width           =   1095
  124.       End
  125.       Begin VB.CheckBox Check2 
  126.          Caption         =   "Border"
  127.          Height          =   375
  128.          Left            =   120
  129.          TabIndex        =   29
  130.          Top             =   360
  131.          Value           =   1  'Checked
  132.          Width           =   1215
  133.       End
  134.       Begin VB.Label Label1 
  135.          Appearance      =   0  'Flat
  136.          Caption         =   "2"
  137.          ForeColor       =   &H80000008&
  138.          Height          =   255
  139.          Left            =   1320
  140.          TabIndex        =   13
  141.          Top             =   1320
  142.          Width           =   375
  143.       End
  144.       Begin VB.Label Label5 
  145.          Alignment       =   2  'Center
  146.          Caption         =   "Bevel Size"
  147.          Height          =   255
  148.          Left            =   120
  149.          TabIndex        =   30
  150.          Top             =   960
  151.          Width           =   1455
  152.       End
  153.    End
  154.    Begin VB.Frame Frame2 
  155.       Caption         =   "Color"
  156.       Height          =   1935
  157.       Left            =   2520
  158.       TabIndex        =   5
  159.       Top             =   1200
  160.       Width           =   1935
  161.       Begin VB.CommandButton Command1 
  162.          Appearance      =   0  'Flat
  163.          BackColor       =   &H80000005&
  164.          Caption         =   "ShadowColor"
  165.          Height          =   375
  166.          Index           =   3
  167.          Left            =   240
  168.          TabIndex        =   9
  169.          Top             =   1440
  170.          Width           =   1455
  171.       End
  172.       Begin VB.CommandButton Command1 
  173.          Appearance      =   0  'Flat
  174.          BackColor       =   &H80000005&
  175.          Caption         =   "LightColor"
  176.          Height          =   375
  177.          Index           =   2
  178.          Left            =   240
  179.          TabIndex        =   8
  180.          Top             =   1080
  181.          Width           =   1455
  182.       End
  183.       Begin VB.CommandButton Command1 
  184.          Appearance      =   0  'Flat
  185.          BackColor       =   &H80000005&
  186.          Caption         =   "FillColor"
  187.          Height          =   375
  188.          Index           =   1
  189.          Left            =   240
  190.          TabIndex        =   7
  191.          Top             =   720
  192.          Width           =   1455
  193.       End
  194.       Begin VB.CommandButton Command1 
  195.          Appearance      =   0  'Flat
  196.          BackColor       =   &H80000005&
  197.          Caption         =   "TextColor"
  198.          Height          =   375
  199.          Index           =   0
  200.          Left            =   240
  201.          TabIndex        =   6
  202.          Top             =   360
  203.          Width           =   1455
  204.       End
  205.    End
  206.    Begin VB.Frame Frame1 
  207.       Caption         =   "Alignment"
  208.       Height          =   1935
  209.       Left            =   240
  210.       TabIndex        =   0
  211.       Top             =   1200
  212.       Width           =   1815
  213.       Begin VB.CheckBox Check1 
  214.          Caption         =   "MultiLine"
  215.          Height          =   375
  216.          Left            =   120
  217.          TabIndex        =   4
  218.          Top             =   1440
  219.          Width           =   1335
  220.       End
  221.       Begin VB.OptionButton Option1 
  222.          Caption         =   "Center"
  223.          Height          =   255
  224.          Index           =   2
  225.          Left            =   120
  226.          TabIndex        =   3
  227.          Top             =   1080
  228.          Value           =   -1  'True
  229.          Width           =   975
  230.       End
  231.       Begin VB.OptionButton Option1 
  232.          Caption         =   "Right"
  233.          Height          =   255
  234.          Index           =   1
  235.          Left            =   120
  236.          TabIndex        =   2
  237.          Top             =   720
  238.          Width           =   975
  239.       End
  240.       Begin VB.OptionButton Option1 
  241.          Caption         =   "Left"
  242.          Height          =   255
  243.          Index           =   0
  244.          Left            =   120
  245.          TabIndex        =   1
  246.          Top             =   360
  247.          Width           =   855
  248.       End
  249.    End
  250.    Begin Mh3dgrpLib.Mh3dGroup Mh3dCommand1 
  251.       Height          =   495
  252.       Index           =   7
  253.       Left            =   4560
  254.       TabIndex        =   22
  255.       Top             =   4080
  256.       Width           =   1335
  257.       _Version        =   65536
  258.       _ExtentX        =   2355
  259.       _ExtentY        =   873
  260.       _StockProps     =   79
  261.       Caption         =   "Group 2"
  262.       BackColor       =   -2147483643
  263.       TintColor       =   16711935
  264.       Alignment       =   2
  265.       AutoSize        =   -1  'True
  266.       BevelSize       =   2
  267.       BorderColor     =   -2147483642
  268.       BorderStyle     =   2
  269.       FillColor       =   -2147483633
  270.       FontTransparent =   -1  'True
  271.       LightColor      =   -2147483643
  272.       Multiline       =   0   'False
  273.       ShadowColor     =   -2147483632
  274.       TextColor       =   -2147483640
  275.       WallPaper       =   0
  276.       StateButton     =   -1  'True
  277.       Value           =   0   'False
  278.       Group           =   2
  279.       DataText        =   ""
  280.       DataStyle       =   0
  281.       NoFocusRect     =   0   'False
  282.    End
  283.    Begin Mh3dgrpLib.Mh3dGroup Mh3dCommand1 
  284.       Height          =   495
  285.       Index           =   6
  286.       Left            =   4560
  287.       TabIndex        =   21
  288.       Top             =   3600
  289.       Width           =   1335
  290.       _Version        =   65536
  291.       _ExtentX        =   2355
  292.       _ExtentY        =   873
  293.       _StockProps     =   79
  294.       Caption         =   "Group 2"
  295.       BackColor       =   -2147483643
  296.       TintColor       =   16711935
  297.       Alignment       =   2
  298.       AutoSize        =   -1  'True
  299.       BevelSize       =   2
  300.       BorderColor     =   -2147483642
  301.       BorderStyle     =   2
  302.       FillColor       =   -2147483633
  303.       FontTransparent =   -1  'True
  304.       LightColor      =   -2147483643
  305.       Multiline       =   0   'False
  306.       ShadowColor     =   -2147483632
  307.       TextColor       =   -2147483640
  308.       WallPaper       =   0
  309.       StateButton     =   -1  'True
  310.       Value           =   0   'False
  311.       Group           =   2
  312.       DataText        =   ""
  313.       DataStyle       =   0
  314.       NoFocusRect     =   0   'False
  315.    End
  316.    Begin Mh3dgrpLib.Mh3dGroup Mh3dCommand1 
  317.       Height          =   495
  318.       Index           =   5
  319.       Left            =   4560
  320.       TabIndex        =   20
  321.       Top             =   3120
  322.       Width           =   1335
  323.       _Version        =   65536
  324.       _ExtentX        =   2355
  325.       _ExtentY        =   873
  326.       _StockProps     =   79
  327.       Caption         =   "Group 1"
  328.       BackColor       =   -2147483643
  329.       TintColor       =   16711935
  330.       Alignment       =   2
  331.       AutoSize        =   -1  'True
  332.       BevelSize       =   2
  333.       BorderColor     =   -2147483642
  334.       BorderStyle     =   2
  335.       FillColor       =   -2147483633
  336.       FontTransparent =   -1  'True
  337.       LightColor      =   -2147483643
  338.       Multiline       =   0   'False
  339.       ShadowColor     =   -2147483632
  340.       TextColor       =   -2147483640
  341.       WallPaper       =   0
  342.       StateButton     =   -1  'True
  343.       Value           =   0   'False
  344.       Group           =   1
  345.       DataText        =   ""
  346.       DataStyle       =   0
  347.       NoFocusRect     =   0   'False
  348.    End
  349.    Begin Mh3dgrpLib.Mh3dGroup Mh3dCommand1 
  350.       Height          =   495
  351.       Index           =   4
  352.       Left            =   4560
  353.       TabIndex        =   19
  354.       Top             =   2640
  355.       Width           =   1335
  356.       _Version        =   65536
  357.       _ExtentX        =   2355
  358.       _ExtentY        =   873
  359.       _StockProps     =   79
  360.       Caption         =   "Group 1"
  361.       BackColor       =   -2147483643
  362.       TintColor       =   16711935
  363.       Alignment       =   2
  364.       AutoSize        =   -1  'True
  365.       BevelSize       =   2
  366.       BorderColor     =   -2147483642
  367.       BorderStyle     =   2
  368.       FillColor       =   -2147483633
  369.       FontTransparent =   -1  'True
  370.       LightColor      =   -2147483643
  371.       Multiline       =   0   'False
  372.       ShadowColor     =   -2147483632
  373.       TextColor       =   -2147483640
  374.       WallPaper       =   0
  375.       StateButton     =   -1  'True
  376.       Value           =   0   'False
  377.       Group           =   1
  378.       DataText        =   ""
  379.       DataStyle       =   0
  380.       NoFocusRect     =   0   'False
  381.    End
  382.    Begin Mh3dgrpLib.Mh3dGroup Mh3dCommand1 
  383.       Height          =   495
  384.       Index           =   3
  385.       Left            =   4560
  386.       TabIndex        =   18
  387.       Top             =   2160
  388.       Width           =   1335
  389.       _Version        =   65536
  390.       _ExtentX        =   2355
  391.       _ExtentY        =   873
  392.       _StockProps     =   79
  393.       Caption         =   "Group 1"
  394.       BackColor       =   -2147483643
  395.       TintColor       =   16711935
  396.       Alignment       =   2
  397.       AutoSize        =   -1  'True
  398.       BevelSize       =   2
  399.       BorderColor     =   -2147483642
  400.       BorderStyle     =   2
  401.       FillColor       =   -2147483633
  402.       FontTransparent =   -1  'True
  403.       LightColor      =   -2147483643
  404.       Multiline       =   0   'False
  405.       ShadowColor     =   -2147483632
  406.       TextColor       =   -2147483640
  407.       WallPaper       =   0
  408.       StateButton     =   -1  'True
  409.       Value           =   0   'False
  410.       Group           =   1
  411.       DataText        =   ""
  412.       DataStyle       =   0
  413.       NoFocusRect     =   0   'False
  414.    End
  415.    Begin Mh3dgrpLib.Mh3dGroup Mh3dCommand1 
  416.       Height          =   495
  417.       Index           =   2
  418.       Left            =   4560
  419.       TabIndex        =   17
  420.       Top             =   1680
  421.       Width           =   1335
  422.       _Version        =   65536
  423.       _ExtentX        =   2355
  424.       _ExtentY        =   873
  425.       _StockProps     =   79
  426.       Caption         =   "Group 0"
  427.       TintColor       =   16711935
  428.       Alignment       =   2
  429.       AutoSize        =   -1  'True
  430.       BevelSize       =   2
  431.       BorderColor     =   -2147483642
  432.       BorderStyle     =   2
  433.       FillColor       =   -2147483633
  434.       FontTransparent =   -1  'True
  435.       LightColor      =   -2147483643
  436.       Multiline       =   0   'False
  437.       PictureDown     =   "mh3dgrp.frx":091E
  438.       PicturePressed  =   "mh3dgrp.frx":093A
  439.       PictureUp       =   "mh3dgrp.frx":0956
  440.       ShadowColor     =   -2147483632
  441.       TextColor       =   -2147483640
  442.       WallPaper       =   0
  443.       StateButton     =   -1  'True
  444.       Value           =   0   'False
  445.       Group           =   0
  446.       DataText        =   ""
  447.       DataStyle       =   0
  448.       NoFocusRect     =   0   'False
  449.    End
  450.    Begin Mh3dgrpLib.Mh3dGroup Mh3dCommand1 
  451.       Height          =   495
  452.       Index           =   1
  453.       Left            =   4560
  454.       TabIndex        =   16
  455.       Top             =   1200
  456.       Width           =   1335
  457.       _Version        =   65536
  458.       _ExtentX        =   2355
  459.       _ExtentY        =   873
  460.       _StockProps     =   79
  461.       Caption         =   "Group 0"
  462.       BackColor       =   -2147483643
  463.       TintColor       =   16711935
  464.       Alignment       =   2
  465.       AutoSize        =   -1  'True
  466.       BevelSize       =   2
  467.       BorderColor     =   -2147483642
  468.       BorderStyle     =   2
  469.       FillColor       =   -2147483633
  470.       FontTransparent =   -1  'True
  471.       LightColor      =   -2147483643
  472.       Multiline       =   0   'False
  473.       PictureDown     =   "mh3dgrp.frx":0972
  474.       PicturePressed  =   "mh3dgrp.frx":098E
  475.       PictureUp       =   "mh3dgrp.frx":09AA
  476.       ShadowColor     =   -2147483632
  477.       TextColor       =   -2147483640
  478.       WallPaper       =   0
  479.       StateButton     =   -1  'True
  480.       Value           =   0   'False
  481.       Group           =   0
  482.       DataText        =   ""
  483.       DataStyle       =   0
  484.       NoFocusRect     =   0   'False
  485.    End
  486.    Begin Mh3dgrpLib.Mh3dGroup Mh3dCommand1 
  487.       Height          =   495
  488.       Index           =   0
  489.       Left            =   4560
  490.       TabIndex        =   15
  491.       Top             =   720
  492.       Width           =   1335
  493.       _Version        =   65536
  494.       _ExtentX        =   2355
  495.       _ExtentY        =   873
  496.       _StockProps     =   79
  497.       Caption         =   "Group 0"
  498.       BackColor       =   -2147483643
  499.       TintColor       =   16711935
  500.       Alignment       =   2
  501.       AutoSize        =   -1  'True
  502.       BevelSize       =   2
  503.       BorderColor     =   -2147483642
  504.       BorderStyle     =   2
  505.       FillColor       =   -2147483633
  506.       FontTransparent =   -1  'True
  507.       LightColor      =   -2147483643
  508.       Multiline       =   0   'False
  509.       PictureDown     =   "mh3dgrp.frx":09C6
  510.       PicturePressed  =   "mh3dgrp.frx":09E2
  511.       PictureUp       =   "mh3dgrp.frx":09FE
  512.       ShadowColor     =   -2147483632
  513.       TextColor       =   -2147483640
  514.       WallPaper       =   0
  515.       StateButton     =   -1  'True
  516.       Value           =   0   'False
  517.       Group           =   0
  518.       DataText        =   ""
  519.       DataStyle       =   0
  520.       NoFocusRect     =   0   'False
  521.    End
  522.    Begin VB.Label Label2 
  523.       BackColor       =   &H00FFFFFF&
  524.       BackStyle       =   0  'Transparent
  525.       BorderStyle     =   1  'Fixed Single
  526.       Caption         =   $"mh3dgrp.frx":0A1A
  527.       ForeColor       =   &H00000000&
  528.       Height          =   975
  529.       Left            =   120
  530.       TabIndex        =   24
  531.       Top             =   120
  532.       Width           =   4335
  533.    End
  534. Attribute VB_Name = "mhgroup"
  535. Attribute VB_Creatable = False
  536. Attribute VB_Exposed = False
  537. Dim LastButton As Integer
  538. Dim CurrentGroup As Integer
  539. Private Sub Check1_Click()
  540. If LastButton > -1 Then
  541.     If Check1.Value Then
  542.         mh3dcommand1(LastButton).Caption = "This is a longer caption so that you can see the multiline feature at work."
  543.         mh3dcommand1(LastButton).MultiLine = -1
  544.     Else
  545.         mh3dcommand1(LastButton).Caption = "Group" + Str$(mh3dcommand1(LastButton).Group)
  546.         mh3dcommand1(LastButton).MultiLine = 0
  547.     End If
  548. End If
  549. End Sub
  550. Private Sub Check2_Click()
  551. If LastButton > -1 Then
  552.   mh3dcommand1(LastButton).BorderStyle = Check2.Value
  553. End If
  554. End Sub
  555. Private Sub Command1_Click(Index As Integer)
  556.     ColorSelect.Show 1
  557.     Select Case Index
  558.         Case 0
  559.             mh3dcommand1(LastButton).TextColor = currentcolor&
  560.         Case 1
  561.             mh3dcommand1(LastButton).FillColor = currentcolor&
  562.         Case 2
  563.             mh3dcommand1(LastButton).LightColor = currentcolor&
  564.         Case 3
  565.             mh3dcommand1(LastButton).ShadowColor = currentcolor&
  566.     End Select
  567. End Sub
  568. Private Sub Command2_Click()
  569. Unload mhgroup
  570. End Sub
  571. Private Sub Form_Load()
  572.     CenterForm Me
  573. End Sub
  574. Private Sub HScroll1_Change()
  575. If LastButton > -1 Then
  576.     label1.Caption = Str$(HScroll1.Value)
  577.     mh3dcommand1(LastButton).BevelSize = HScroll1.Value
  578. End If
  579. End Sub
  580. Private Sub Label4_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  581. CurrentGroup = Index
  582. Label4(Index).Drag
  583. End Sub
  584. Private Sub Mh3dCommand1_Click(Index As Integer)
  585. LastButton = Index
  586. End Sub
  587. Private Sub Mh3dCommand1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
  588. mh3dcommand1(Index).Group = CurrentGroup
  589. mh3dcommand1(Index).Caption = "Group" + Str$(CurrentGroup)
  590. End Sub
  591. Private Sub Mh3dCommand1_GotFocus(Index As Integer)
  592. LastButton = -1
  593. If mh3dcommand1(Index).MultiLine Then
  594.     Check1.Value = 1
  595. End If
  596. If mh3dcommand1(Index).BorderStyle Then
  597.     Check2.Value = 1
  598. End If
  599. HScroll1.Value = mh3dcommand1(Index).BevelSize
  600. label1.Caption = Str$(HScroll1.Value)
  601. Option1(mh3dcommand1(Index).Alignment).Value = -1
  602. LastButton = Index
  603. End Sub
  604. Private Sub Option1_Click(Index As Integer)
  605. If LastButton > -1 Then
  606.     mh3dcommand1(LastButton).Alignment = Index
  607. End If
  608. End Sub
  609.