home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 February / PCWK0297.iso / envelop / envelop.6 / Tools / Bootcamp / concepts / extended / extended.eto < prev    next >
Text File  |  1996-07-08  |  4KB  |  140 lines

  1. Type ExtendedControlForm From SampleMasterForm
  2.   Dim Label1 As New Label
  3.   Dim Label2 As New Label
  4.   Dim Label3 As New Label
  5.   Dim IntegerTextBox1 As New IntegerTextBox
  6.   Dim LCaseTextBox1 As New LCaseTextBox
  7.   Dim UCaseTextBox1 As New UCaseTextBox
  8.  
  9.   ' METHODS for object: ExtendedControlForm
  10.   Sub ResetApplication_Click
  11.     IntegerTextBox1.Text = ""
  12.     LCaseTextBox1.Text = ""
  13.     UCaseTextBox1.Text = ""
  14.   End Sub
  15.  
  16. End Type
  17.  
  18. Type IntegerTextBox From TextBox
  19.  
  20.   ' METHODS for object: IntegerTextBox
  21.   Sub KeyPress(keyAscii As Integer)
  22.     ' If we are entering a backspace, allow it
  23.     If keyAscii == 8 Then Exit Sub
  24.   
  25.     ' Check to see if a valid integer or a space has been entered
  26.     Select Case keyAscii
  27.       Case 48 To 57
  28.       Case 32
  29.       Case Else
  30.         keyAscii = 0
  31.     End Select
  32.   End Sub
  33.  
  34. End Type
  35.  
  36. Type LCaseTextBox From TextBox
  37.  
  38.   ' METHODS for object: LCaseTextBox
  39.   Sub KeyPress(keyAscii As Integer)
  40.     ' If we are entering a backspace, allow it
  41.     If keyAscii == 8 Then Exit Sub
  42.   
  43.     ' Check to see if a valid integer or a space has been entered
  44.     Select Case keyAscii
  45.       Case 65 To 90 ' upper case characters
  46.         ' Need to convert keyAscii to Upper Case
  47.         Dim char As String
  48.         char = LCase(Chr(keyAscii))
  49.         keyAscii = Asc(char)
  50.       Case 97 To 122 ' lower case characters
  51.       Case 32 ' backspace
  52.       Case Else
  53.         keyAscii = 0
  54.     End Select
  55.   End Sub
  56.  
  57. End Type
  58.  
  59. Type UCaseTextBox From TextBox
  60.  
  61.   ' METHODS for object: UCaseTextBox
  62.   Sub KeyPress(keyAscii As Integer)
  63.     ' If we are entering a backspace, allow it
  64.     If keyAscii == 8 Then Exit Sub
  65.   
  66.     ' Check to see if a valid integer or a space has been entered
  67.     Select Case keyAscii
  68.       Case 65 To 90 ' upper case characters
  69.       Case 97 To 122 ' lower case characters
  70.         ' Need to convert keyAscii to Upper Case
  71.         Dim char As String
  72.         char = UCase(Chr(keyAscii))
  73.         keyAscii = Asc(char)
  74.       Case 32 ' backspace
  75.       Case Else
  76.         keyAscii = 0
  77.     End Select
  78.   End Sub
  79.  
  80. End Type
  81.  
  82. Begin Code
  83. ' Reconstruction commands for object: ExtendedControlForm
  84. '
  85.   With ExtendedControlForm
  86.     .Caption := "Extended Control Example"
  87.     .Move(4560, 1935, 4995, 4605)
  88.     .SampleDir := "C:\envelop\bootcamp\concepts\extended\"
  89.     .SampleName := "extended"
  90.     With .Label1
  91.       .Caption := "TextBox for Integers"
  92.       .ForeColor := 16711680
  93.       .Move(300, 300, 2100, 300)
  94.     End With  'ExtendedControlForm.Label1
  95.     With .Label2
  96.       .Caption := "TextBox for Upper-Case Characters"
  97.       .ForeColor := 16711680
  98.       .Move(300, 1500, 3600, 300)
  99.     End With  'ExtendedControlForm.Label2
  100.     With .Label3
  101.       .Caption := "TextBox for Lower-Case Characters"
  102.       .ForeColor := 16711680
  103.       .Move(300, 2700, 3600, 300)
  104.     End With  'ExtendedControlForm.Label3
  105.     With .IntegerTextBox1
  106.       .Move(750, 750, 3450, 450)
  107.       .MaxLength := 10
  108.     End With  'ExtendedControlForm.IntegerTextBox1
  109.     With .LCaseTextBox1
  110.       .Move(750, 3150, 3450, 450)
  111.       .MaxLength := 10
  112.     End With  'ExtendedControlForm.LCaseTextBox1
  113.     With .UCaseTextBox1
  114.       .Move(750, 1950, 3450, 450)
  115.       .MaxLength := 10
  116.     End With  'ExtendedControlForm.UCaseTextBox1
  117.     With .helpfile
  118.       .FileName := "C:\envelop\bootcamp\concepts\extended\extended.hlp"
  119.     End With  'ExtendedControlForm.helpfile
  120.   End With  'ExtendedControlForm
  121. ' Reconstruction commands for object: IntegerTextBox
  122. '
  123.   With IntegerTextBox
  124.     .Move(0, 0, 0, 0)
  125.     .MaxLength := 0
  126.   End With  'IntegerTextBox
  127. ' Reconstruction commands for object: LCaseTextBox
  128. '
  129.   With LCaseTextBox
  130.     .Move(0, 0, 0, 0)
  131.     .MaxLength := 0
  132.   End With  'LCaseTextBox
  133. ' Reconstruction commands for object: UCaseTextBox
  134. '
  135.   With UCaseTextBox
  136.     .Move(0, 0, 0, 0)
  137.     .MaxLength := 0
  138.   End With  'UCaseTextBox
  139. End Code
  140.