Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing SetValueForm.frm (2.74 KB)
VERSION 5.00
Begin VB.Form SetValueForm
BorderStyle = 3 'Fixed Dialog
Caption = "(Caption)"
ClientHeight = 1095
ClientLeft = 45
ClientTop = 330
ClientWidth = 4830
ClipControls = 0 'False
Icon = "SetValueForm.frx":0000
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1095
ScaleWidth = 4830
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 3480
TabIndex = 3
Top = 600
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "OK"
Default = -1 'True
Enabled = 0 'False
Height = 375
Left = 2160
TabIndex = 2
Top = 600
Width = 1215
End
Begin VB.TextBox Text1
Height = 315
Left = 1080
MaxLength = 300
TabIndex = 1
Top = 120
Width = 3615
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "(Command)"
Height = 195
Left = 120
TabIndex = 0
Top = 180
Width = 795
End
End
Attribute VB_Name = "SetValueForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim AllowNoValue As Boolean
Dim ReturnNullChar As Boolean
Sub SetFlags(Flags As Long)
If (Flags And GI_DEFAULTENABLED) > 0 Then Command1.Enabled = True
If (Flags And GI_ALLOWNOVALUE) > 0 Then AllowNoValue = True
If (Flags And GI_RETURNNULLCHAR) > 0 Then ReturnNullChar = True
If (Flags And GI_MASKINPUT) > 0 Then Text1.PasswordChar = "*"
End Sub
Private Sub Command1_Click()
SetValueFormValue = Text1.Text
Unload Me
End Sub
Private Sub Command2_Click()
If ReturnNullChar Then
SetValueFormValue = Chr(0)
Else
SetValueFormValue = ""
End If
Unload Me
End Sub
Private Sub Form_Load()
AllowNoValue = False
ReturnNullChar = False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then
If ReturnNullChar Then
SetValueFormValue = Chr(0)
Else
SetValueFormValue = ""
End If
End If
End Sub
Private Sub Text1_Change()
If Not AllowNoValue Then
If Text1.Text = "" Then Command1.Enabled = False
If Text1.Text <> "" Then Command1.Enabled = True
End If
End Sub