home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / ct_ocx / ct_fold.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-01-03  |  13.7 KB  |  435 lines

  1. VERSION 4.00
  2. Begin VB.Form w_fold_demo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "ctFold (Tabbed File Folder) Demo"
  6.    ClientHeight    =   6195
  7.    ClientLeft      =   1230
  8.    ClientTop       =   1815
  9.    ClientWidth     =   8190
  10.    Height          =   6600
  11.    Icon            =   "ct_fold.frx":0000
  12.    Left            =   1170
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MDIChild        =   -1  'True
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   6195
  18.    ScaleWidth      =   8190
  19.    ShowInTaskbar   =   0   'False
  20.    Top             =   1470
  21.    Width           =   8310
  22.    Begin VB.Frame Frame2 
  23.       Caption         =   "Enabled Tabs"
  24.       BeginProperty Font 
  25.          name            =   "MS Sans Serif"
  26.          charset         =   0
  27.          weight          =   700
  28.          size            =   8.25
  29.          underline       =   0   'False
  30.          italic          =   0   'False
  31.          strikethrough   =   0   'False
  32.       EndProperty
  33.       Height          =   675
  34.       Left            =   180
  35.       TabIndex        =   10
  36.       Top             =   5400
  37.       Width           =   5595
  38.       Begin CheckLib.ctCheck chk_6 
  39.          Height          =   315
  40.          Left            =   4680
  41.          TabIndex        =   22
  42.          Top             =   240
  43.          Width           =   795
  44.          _version        =   65536
  45.          _extentx        =   1402
  46.          _extenty        =   556
  47.          _stockprops     =   70
  48.          caption         =   "Tab 6"
  49.          picstyle        =   2
  50.          value           =   -1  'True
  51.       End
  52.       Begin CheckLib.ctCheck chk_5 
  53.          Height          =   315
  54.          Left            =   3780
  55.          TabIndex        =   21
  56.          Top             =   240
  57.          Width           =   735
  58.          _version        =   65536
  59.          _extentx        =   1296
  60.          _extenty        =   556
  61.          _stockprops     =   70
  62.          caption         =   "Tab 5"
  63.          picstyle        =   2
  64.          value           =   -1  'True
  65.       End
  66.       Begin CheckLib.ctCheck chk_4 
  67.          Height          =   315
  68.          Left            =   2880
  69.          TabIndex        =   20
  70.          Top             =   240
  71.          Width           =   795
  72.          _version        =   65536
  73.          _extentx        =   1402
  74.          _extenty        =   556
  75.          _stockprops     =   70
  76.          caption         =   "Tab 4"
  77.          picstyle        =   2
  78.          value           =   -1  'True
  79.       End
  80.       Begin CheckLib.ctCheck chk_3 
  81.          Height          =   315
  82.          Left            =   1980
  83.          TabIndex        =   19
  84.          Top             =   240
  85.          Width           =   795
  86.          _version        =   65536
  87.          _extentx        =   1402
  88.          _extenty        =   556
  89.          _stockprops     =   70
  90.          caption         =   "Tab 3"
  91.          picstyle        =   2
  92.          value           =   -1  'True
  93.       End
  94.       Begin CheckLib.ctCheck chk_2 
  95.          Height          =   315
  96.          Left            =   1080
  97.          TabIndex        =   18
  98.          Top             =   240
  99.          Width           =   795
  100.          _version        =   65536
  101.          _extentx        =   1402
  102.          _extenty        =   556
  103.          _stockprops     =   70
  104.          caption         =   "Tab 2"
  105.          picstyle        =   2
  106.          value           =   -1  'True
  107.       End
  108.       Begin CheckLib.ctCheck chk_1 
  109.          Height          =   315
  110.          Left            =   180
  111.          TabIndex        =   17
  112.          Top             =   240
  113.          Width           =   795
  114.          _version        =   65536
  115.          _extentx        =   1402
  116.          _extenty        =   556
  117.          _stockprops     =   70
  118.          caption         =   "Tab 1"
  119.          picstyle        =   2
  120.          value           =   -1  'True
  121.       End
  122.    End
  123.    Begin VB.ComboBox cmb_pic 
  124.       Height          =   315
  125.       Left            =   6000
  126.       Style           =   2  'Dropdown List
  127.       TabIndex        =   9
  128.       Top             =   4620
  129.       Width           =   1815
  130.    End
  131.    Begin VB.ComboBox cmb_side 
  132.       Height          =   315
  133.       Left            =   6000
  134.       Style           =   2  'Dropdown List
  135.       TabIndex        =   6
  136.       Top             =   3960
  137.       Width           =   1815
  138.    End
  139.    Begin VB.Frame Frame1 
  140.       Caption         =   "Levels"
  141.       BeginProperty Font 
  142.          name            =   "MS Sans Serif"
  143.          charset         =   0
  144.          weight          =   700
  145.          size            =   8.25
  146.          underline       =   0   'False
  147.          italic          =   0   'False
  148.          strikethrough   =   0   'False
  149.       EndProperty
  150.       Height          =   735
  151.       Left            =   6060
  152.       TabIndex        =   3
  153.       Top             =   1320
  154.       Width           =   1695
  155.       Begin VB.OptionButton Option2 
  156.          Caption         =   "2"
  157.          Height          =   315
  158.          Left            =   960
  159.          TabIndex        =   5
  160.          Top             =   300
  161.          Value           =   -1  'True
  162.          Width           =   435
  163.       End
  164.       Begin VB.OptionButton Option1 
  165.          Caption         =   "1"
  166.          Height          =   315
  167.          Left            =   240
  168.          TabIndex        =   4
  169.          Top             =   300
  170.          Width           =   435
  171.       End
  172.    End
  173.    Begin VB.CommandButton Command1 
  174.       Caption         =   "E&xit"
  175.       BeginProperty Font 
  176.          name            =   "MS Sans Serif"
  177.          charset         =   0
  178.          weight          =   700
  179.          size            =   8.25
  180.          underline       =   0   'False
  181.          italic          =   0   'False
  182.          strikethrough   =   0   'False
  183.       EndProperty
  184.       Height          =   435
  185.       Left            =   6900
  186.       TabIndex        =   2
  187.       Top             =   5640
  188.       Width           =   1035
  189.    End
  190.    Begin FoldLib.ctFold ctFold1 
  191.       Height          =   4215
  192.       Left            =   180
  193.       TabIndex        =   0
  194.       Top             =   1080
  195.       Width           =   5475
  196.       _version        =   65536
  197.       _extentx        =   9657
  198.       _extenty        =   7435
  199.       _stockprops     =   70
  200.       caption         =   "Table;Query;Form;Report;Macro;Module"
  201.       BeginProperty selectedfont {FB8F0823-0164-101B-84ED-08002B2EC713} 
  202.          name            =   "MS Sans Serif"
  203.          charset         =   1
  204.          weight          =   700
  205.          size            =   8.25
  206.          underline       =   0   'False
  207.          italic          =   0   'False
  208.          strikethrough   =   0   'False
  209.       EndProperty
  210.       backcolor       =   12632256
  211.       picsequence     =   "1,2,3,4,5,6"
  212.       backsequence    =   ""
  213.       textsequence    =   ""
  214.       disablesequence =   ""
  215.       picture         =   "ct_fold.frx":030A
  216.       picposition     =   3
  217.       piccols         =   2
  218.       picrows         =   3
  219.       tabheight       =   45
  220.       levels          =   2
  221.       amount          =   6
  222.    End
  223.    Begin CheckLib.ctCheck chk_confirm 
  224.       Height          =   315
  225.       Left            =   6060
  226.       TabIndex        =   16
  227.       Top             =   3240
  228.       Width           =   1455
  229.       _version        =   65536
  230.       _extentx        =   2566
  231.       _extenty        =   556
  232.       _stockprops     =   70
  233.       caption         =   "Confirm Change"
  234.    End
  235.    Begin CheckLib.ctCheck chk_flat 
  236.       Height          =   315
  237.       Left            =   6060
  238.       TabIndex        =   15
  239.       Top             =   2880
  240.       Width           =   1635
  241.       _version        =   65536
  242.       _extentx        =   2884
  243.       _extenty        =   556
  244.       _stockprops     =   70
  245.       caption         =   "Flat Tabs"
  246.    End
  247.    Begin CheckLib.ctCheck chk_color 
  248.       Height          =   315
  249.       Left            =   6060
  250.       TabIndex        =   14
  251.       Top             =   2520
  252.       Width           =   1575
  253.       _version        =   65536
  254.       _extentx        =   2778
  255.       _extenty        =   556
  256.       _stockprops     =   70
  257.       caption         =   "Color Sequence"
  258.    End
  259.    Begin CheckLib.ctCheck chk_fixed 
  260.       Height          =   315
  261.       Left            =   6060
  262.       TabIndex        =   13
  263.       Top             =   2160
  264.       Width           =   1455
  265.       _version        =   65536
  266.       _extentx        =   2566
  267.       _extenty        =   556
  268.       _stockprops     =   70
  269.       caption         =   "Fixed Size"
  270.    End
  271.    Begin VB.Label lbl_tab 
  272.       Caption         =   "1"
  273.       BeginProperty Font 
  274.          name            =   "MS Sans Serif"
  275.          charset         =   0
  276.          weight          =   700
  277.          size            =   8.25
  278.          underline       =   0   'False
  279.          italic          =   0   'False
  280.          strikethrough   =   0   'False
  281.       EndProperty
  282.       ForeColor       =   &H00800000&
  283.       Height          =   255
  284.       Left            =   7380
  285.       TabIndex        =   12
  286.       Top             =   5100
  287.       Width           =   315
  288.    End
  289.    Begin VB.Label Label4 
  290.       Caption         =   "Tab Selected :"
  291.       Height          =   255
  292.       Left            =   6240
  293.       TabIndex        =   11
  294.       Top             =   5100
  295.       Width           =   1155
  296.    End
  297.    Begin VB.Label Label3 
  298.       Caption         =   "Picture Position"
  299.       Height          =   195
  300.       Left            =   6000
  301.       TabIndex        =   8
  302.       Top             =   4380
  303.       Width           =   1455
  304.    End
  305.    Begin VB.Label Label2 
  306.       Caption         =   "Tab Side"
  307.       Height          =   255
  308.       Left            =   6000
  309.       TabIndex        =   7
  310.       Top             =   3720
  311.       Width           =   1095
  312.    End
  313.    Begin VB.Shape Shape1 
  314.       Height          =   4275
  315.       Left            =   5880
  316.       Top             =   1140
  317.       Width           =   2055
  318.    End
  319.    Begin VB.Label Label1 
  320.       Alignment       =   2  'Center
  321.       Caption         =   $"ct_fold.frx":08AC
  322.       BeginProperty Font 
  323.          name            =   "MS Sans Serif"
  324.          charset         =   0
  325.          weight          =   700
  326.          size            =   8.25
  327.          underline       =   0   'False
  328.          italic          =   0   'False
  329.          strikethrough   =   0   'False
  330.       EndProperty
  331.       ForeColor       =   &H00800000&
  332.       Height          =   915
  333.       Left            =   300
  334.       TabIndex        =   1
  335.       Top             =   60
  336.       Width           =   7755
  337.    End
  338. Attribute VB_Name = "w_fold_demo"
  339. Attribute VB_Creatable = False
  340. Attribute VB_Exposed = False
  341. Private Sub chk_1_ChangeValue(bValue As Integer)
  342.    ctFold1.DisableSequence = Disabled_Tabs()
  343. End Sub
  344. Private Sub chk_2_ChangeValue(bValue As Integer)
  345.    ctFold1.DisableSequence = Disabled_Tabs()
  346. End Sub
  347. Private Sub chk_3_ChangeValue(bValue As Integer)
  348.    ctFold1.DisableSequence = Disabled_Tabs()
  349. End Sub
  350. Private Sub chk_4_ChangeValue(bValue As Integer)
  351.    ctFold1.DisableSequence = Disabled_Tabs()
  352. End Sub
  353. Private Sub chk_5_ChangeValue(bValue As Integer)
  354.    ctFold1.DisableSequence = Disabled_Tabs()
  355. End Sub
  356. Private Sub chk_6_ChangeValue(bValue As Integer)
  357.    ctFold1.DisableSequence = Disabled_Tabs()
  358. End Sub
  359. Private Sub chk_color_ChangeValue(bValue As Integer)
  360.     If chk_color.Value Then
  361.       ctFold1.BackSequence = "1,2,3,4,5,1"
  362.       ctFold1.TextSequence = "5,5,0,0,1,0"
  363.    Else
  364.       ctFold1.BackSequence = ""
  365.       ctFold1.TextSequence = ""
  366.    End If
  367. End Sub
  368. Private Sub chk_fixed_ChangeValue(bValue As Integer)
  369.    ctFold1.FixedSize = chk_fixed.Value
  370. End Sub
  371. Private Sub chk_flat_ChangeValue(bValue As Integer)
  372.    If (chk_flat.Value) Then
  373.       ctFold1.TabBorder = 0
  374.    Else
  375.       ctFold1.TabBorder = 1
  376.    End If
  377. End Sub
  378. Private Sub cmb_pic_Click()
  379.    ctFold1.PicPosition = cmb_pic.ListIndex
  380. End Sub
  381. Private Sub cmb_side_Click()
  382.    If cmb_side.ListIndex <= 1 Then
  383.       ctFold1.TabHeight = 45
  384.       ctFold1.TabWidth = 60
  385.    Else
  386.       ctFold1.TabHeight = 60
  387.       ctFold1.TabWidth = 60
  388.    End If
  389.    ctFold1.TabSide = cmb_side.ListIndex
  390. End Sub
  391. Private Sub Command1_Click()
  392.    Unload w_fold_demo
  393. End Sub
  394. Function Disabled_Tabs()
  395.    Dim cString As String
  396.    cString = IIf(chk_1.Value = False, "1,", "0,")
  397.    cString = cString + IIf(chk_2.Value = False, "1,", "0,")
  398.    cString = cString + IIf(chk_3.Value = False, "1,", "0,")
  399.    cString = cString + IIf(chk_4.Value = False, "1,", "0,")
  400.    cString = cString + IIf(chk_5.Value = False, "1,", "0,")
  401.    cString = cString + IIf(chk_6.Value = False, "1", "0")
  402.    Disabled_Tabs = cString
  403. End Function
  404. Private Sub ctFold1_CheckChange()
  405.    If (chk_confirm.Value = True) Then
  406.       If MsgBox("Do you really want to change tabs?", vbYesNo + vbQuestion, "Confirm Change") = vbNo Then
  407.          ctFold1.CancelChange
  408.       End If
  409.    End If
  410. End Sub
  411. Private Sub ctFold1_TabChange(nNewTab As Integer, nOldTab As Integer)
  412.    lbl_tab.Caption = Str(nNewTab)
  413. End Sub
  414. Private Sub Form_Load()
  415.    ' Center the window on the screen
  416.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * 0.15
  417.    cmb_side.AddItem "0 - Top"
  418.    cmb_side.AddItem "1 - Bottom"
  419.    cmb_side.AddItem "2 - Left"
  420.    cmb_side.AddItem "3 - Right"
  421.    cmb_side.ListIndex = 0
  422.    cmb_pic.AddItem "0 - None"
  423.    cmb_pic.AddItem "1 - Top"
  424.    cmb_pic.AddItem "2 - Bottom"
  425.    cmb_pic.AddItem "3 - Left"
  426.    cmb_pic.AddItem "4 - Right"
  427.    cmb_pic.ListIndex = 3
  428. End Sub
  429. Private Sub Option1_Click()
  430.    ctFold1.Levels = 1
  431. End Sub
  432. Private Sub Option2_Click()
  433.   ctFold1.Levels = 2
  434. End Sub
  435.