Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing GetUserInputMod.bas (1.15 KB)
Attribute VB_Name = "GetUserInputMod"
Option Explicit
Public Const GI_DEFAULTENABLED = &H10
Public Const GI_ALLOWNOVALUE = &H20
Public Const GI_RETURNNULLCHAR = &H40
Public SetValueFormValue As String
Public Function GetUserInput(Prompt As String, Optional ByVal Title As String, Optional Default As String, Optional MaxLength As Long, Optional Flags As Long) As String
SetValueForm.Label1.Caption = Prompt
SetValueForm.Caption = IIf(Title = "", App.Title, Title)
If Default <> "" Then
SetValueForm.Text1.Text = Default
SetValueForm.Text1.SelStart = 0
SetValueForm.Text1.SelLength = Len(Default)
End If
If MaxLength > 0 Then SetValueForm.Text1.MaxLength = MaxLength
SetValueForm.Text1.Left = SetValueForm.Label1.Left + SetValueForm.Label1.Width + 100
SetValueForm.Command1.Left = SetValueForm.Text1.Left + 1080
SetValueForm.Command2.Left = SetValueForm.Command1.Left + SetValueForm.Command1.Width + 105
SetValueForm.Width = SetValueForm.Text1.Left + SetValueForm.Text1.Width + 240
SetValueForm.SetFlags Flags
SetValueForm.Show 1
GetUserInput = SetValueFormValue
End Function