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 >
Wrap
Text File
|
1996-07-08
|
4KB
|
140 lines
Type ExtendedControlForm From SampleMasterForm
Dim Label1 As New Label
Dim Label2 As New Label
Dim Label3 As New Label
Dim IntegerTextBox1 As New IntegerTextBox
Dim LCaseTextBox1 As New LCaseTextBox
Dim UCaseTextBox1 As New UCaseTextBox
' METHODS for object: ExtendedControlForm
Sub ResetApplication_Click
IntegerTextBox1.Text = ""
LCaseTextBox1.Text = ""
UCaseTextBox1.Text = ""
End Sub
End Type
Type IntegerTextBox From TextBox
' METHODS for object: IntegerTextBox
Sub KeyPress(keyAscii As Integer)
' If we are entering a backspace, allow it
If keyAscii == 8 Then Exit Sub
' Check to see if a valid integer or a space has been entered
Select Case keyAscii
Case 48 To 57
Case 32
Case Else
keyAscii = 0
End Select
End Sub
End Type
Type LCaseTextBox From TextBox
' METHODS for object: LCaseTextBox
Sub KeyPress(keyAscii As Integer)
' If we are entering a backspace, allow it
If keyAscii == 8 Then Exit Sub
' Check to see if a valid integer or a space has been entered
Select Case keyAscii
Case 65 To 90 ' upper case characters
' Need to convert keyAscii to Upper Case
Dim char As String
char = LCase(Chr(keyAscii))
keyAscii = Asc(char)
Case 97 To 122 ' lower case characters
Case 32 ' backspace
Case Else
keyAscii = 0
End Select
End Sub
End Type
Type UCaseTextBox From TextBox
' METHODS for object: UCaseTextBox
Sub KeyPress(keyAscii As Integer)
' If we are entering a backspace, allow it
If keyAscii == 8 Then Exit Sub
' Check to see if a valid integer or a space has been entered
Select Case keyAscii
Case 65 To 90 ' upper case characters
Case 97 To 122 ' lower case characters
' Need to convert keyAscii to Upper Case
Dim char As String
char = UCase(Chr(keyAscii))
keyAscii = Asc(char)
Case 32 ' backspace
Case Else
keyAscii = 0
End Select
End Sub
End Type
Begin Code
' Reconstruction commands for object: ExtendedControlForm
'
With ExtendedControlForm
.Caption := "Extended Control Example"
.Move(4560, 1935, 4995, 4605)
.SampleDir := "C:\envelop\bootcamp\concepts\extended\"
.SampleName := "extended"
With .Label1
.Caption := "TextBox for Integers"
.ForeColor := 16711680
.Move(300, 300, 2100, 300)
End With 'ExtendedControlForm.Label1
With .Label2
.Caption := "TextBox for Upper-Case Characters"
.ForeColor := 16711680
.Move(300, 1500, 3600, 300)
End With 'ExtendedControlForm.Label2
With .Label3
.Caption := "TextBox for Lower-Case Characters"
.ForeColor := 16711680
.Move(300, 2700, 3600, 300)
End With 'ExtendedControlForm.Label3
With .IntegerTextBox1
.Move(750, 750, 3450, 450)
.MaxLength := 10
End With 'ExtendedControlForm.IntegerTextBox1
With .LCaseTextBox1
.Move(750, 3150, 3450, 450)
.MaxLength := 10
End With 'ExtendedControlForm.LCaseTextBox1
With .UCaseTextBox1
.Move(750, 1950, 3450, 450)
.MaxLength := 10
End With 'ExtendedControlForm.UCaseTextBox1
With .helpfile
.FileName := "C:\envelop\bootcamp\concepts\extended\extended.hlp"
End With 'ExtendedControlForm.helpfile
End With 'ExtendedControlForm
' Reconstruction commands for object: IntegerTextBox
'
With IntegerTextBox
.Move(0, 0, 0, 0)
.MaxLength := 0
End With 'IntegerTextBox
' Reconstruction commands for object: LCaseTextBox
'
With LCaseTextBox
.Move(0, 0, 0, 0)
.MaxLength := 0
End With 'LCaseTextBox
' Reconstruction commands for object: UCaseTextBox
'
With UCaseTextBox
.Move(0, 0, 0, 0)
.MaxLength := 0
End With 'UCaseTextBox
End Code