home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / COMPTOOL / ACTVCOMP / CTLPLUS / CPSLGEN.PAG < prev    next >
Encoding:
Text File  |  1996-11-26  |  4.4 KB  |  148 lines

  1. VERSION 5.00
  2. Begin VB.PropertyPage SLGeneral 
  3.    Caption         =   "General"
  4.    ClientHeight    =   3495
  5.    ClientLeft      =   0
  6.    ClientTop       =   0
  7.    ClientWidth     =   5925
  8.    PaletteMode     =   0  'Halftone
  9.    ScaleHeight     =   3495
  10.    ScaleWidth      =   5925
  11.    Begin VB.CheckBox chkEnabled 
  12.       Caption         =   "Enabled"
  13.       Height          =   285
  14.       Left            =   90
  15.       TabIndex        =   4
  16.       Top             =   1420
  17.       Width           =   2700
  18.    End
  19.    Begin VB.TextBox txtCaption 
  20.       Height          =   330
  21.       Left            =   90
  22.       TabIndex        =   3
  23.       Top             =   1020
  24.       Width           =   2700
  25.    End
  26.    Begin VB.TextBox txtBorderWidth 
  27.       Height          =   330
  28.       Left            =   90
  29.       TabIndex        =   1
  30.       Top             =   370
  31.       Width           =   765
  32.    End
  33.    Begin VB.ComboBox cboAlignment 
  34.       Height          =   315
  35.       Left            =   120
  36.       Style           =   2  'Dropdown List
  37.       TabIndex        =   5
  38.       Top             =   2056
  39.       Width           =   2655
  40.    End
  41.    Begin VB.Label Label1 
  42.       Caption         =   "Alignment"
  43.       Height          =   240
  44.       Left            =   120
  45.       TabIndex        =   6
  46.       Top             =   1800
  47.       Width           =   2700
  48.    End
  49.    Begin VB.Label lblCaption 
  50.       Caption         =   "Caption:"
  51.       Height          =   240
  52.       Left            =   90
  53.       TabIndex        =   2
  54.       Top             =   770
  55.       Width           =   2700
  56.    End
  57.    Begin VB.Label lblBorderWidth 
  58.       Caption         =   "BorderWidth:"
  59.       Height          =   240
  60.       Left            =   90
  61.       TabIndex        =   0
  62.       Top             =   120
  63.       Width           =   2700
  64.    End
  65. End
  66. Attribute VB_Name = "SLGeneral"
  67. Attribute VB_GlobalNameSpace = False
  68. Attribute VB_Creatable = True
  69. Attribute VB_PredeclaredId = False
  70. Attribute VB_Exposed = True
  71. Option Explicit
  72. ' m_blnInSelectionChanged flag prevents the
  73. '   initial loading of property values in
  74. '   the SelectionChanged event from setting
  75. '   Changed = True for all the properties
  76. '   on the page.
  77. Private m_blnInSelectionChanged As Boolean
  78.  
  79. Private Sub cboAlignment_Click()
  80.     If Not m_blnInSelectionChanged Then Changed = True
  81. End Sub
  82.  
  83. Private Sub chkEnabled_Click()
  84.     If Not m_blnInSelectionChanged Then Changed = True
  85. End Sub
  86.  
  87. Private Sub txtBorderWidth_KeyPress(KeyAscii As Integer)
  88.     ' Restrict keystrokes to the digits
  89.     '   (0 - 9) and the backspace.
  90.     Select Case KeyAscii
  91.         Case 48 To 57, 8
  92.         Case Else
  93.             Beep
  94.             KeyAscii = 0
  95.     End Select
  96. End Sub
  97.  
  98. Private Sub txtCaption_Change()
  99.     If Not m_blnInSelectionChanged Then Changed = True
  100. End Sub
  101.  
  102. Private Sub txtBorderWidth_Change()
  103.     If Not m_blnInSelectionChanged Then Changed = True
  104. End Sub
  105.  
  106. Private Sub PropertyPage_ApplyChanges()
  107.     Dim intCt As Integer
  108.     Dim objBadValue As Object
  109.     
  110.     ' Properties that only make sense to
  111.     '   set for the first selected
  112.     '   control:
  113.     SelectedControls(0).Caption = txtCaption.Text
  114.     
  115.     ' Properties that make sense to set
  116.     '   for all the selected controls:
  117.     For intCt = 0 To SelectedControls.Count - 1
  118.         SelectedControls(intCt).Alignment = cboAlignment.ListIndex
  119.         SelectedControls(intCt).Enabled = (chkEnabled.Value = vbChecked)
  120.         SelectedControls(intCt).BorderWidth = txtBorderWidth.Text
  121.     Next
  122. End Sub
  123.  
  124. Private Sub PropertyPage_SelectionChanged()
  125.     m_blnInSelectionChanged = True
  126.     
  127.     ' Set up values for drop downs.  (Do not
  128.     '   do this in the Initialize event.)
  129.     '
  130.     ' Alignment:  Add in order of enum values,
  131.     '   so the index equals the enum value.
  132.     cboAlignment.Clear
  133.     cboAlignment.AddItem vbLeftJustify & " - vbLeftJustify", vbLeftJustify
  134.     cboAlignment.AddItem vbRightJustify & " - vbRightJustify", vbRightJustify
  135.     cboAlignment.AddItem vbCenter & " - vbCenter", vbCenter
  136.     
  137.     ' Read values to display.  Use value from
  138.     '   first selected control.
  139.     chkEnabled.Value = (SelectedControls(0).Enabled And vbChecked)
  140.     txtCaption.Text = SelectedControls(0).Caption
  141.     txtBorderWidth.Text = SelectedControls(0).BorderWidth
  142.     cboAlignment.ListIndex = SelectedControls(0).Alignment
  143.     
  144.     m_blnInSelectionChanged = False
  145. End Sub
  146.  
  147.  
  148.