-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInputBoxDialog.vb
36 lines (36 loc) · 1.29 KB
/
InputBoxDialog.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Public Class InputBoxDialog
' on INPUT:
Friend InpTit As String ' title
Friend InpSay As String ' display text
' on RETURN:
Friend OutResp As String ' answer (on entry contains default)
Friend OKBut As Boolean ' which button
Private Sub CancelB_Click(sender As Object, e As EventArgs) Handles CancelB.Click
OKBut = False
Me.Visible = False
End Sub
Private Sub OkB_Click(sender As Object, e As EventArgs) Handles OkB.Click
OKBut = True
If Response.Text.Length > 0 Then
OutResp = Response.Text
End If
Me.Visible = False
End Sub
Private Sub InputBoxDialog_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Me.Text = InpTit
Says.Text = InpSay
Response.Text = ""
Response.Focus()
Me.Refresh()
End Sub
Private Sub Response_KeyDown(sender As Object, e As KeyEventArgs) Handles Response.KeyDown
If e.KeyCode = 13 Then
OkB_Click(sender, New EventArgs())
End If
End Sub
Private Sub InputBoxDialog_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Top = MeTop ' overlap xeditscreen
Me.Left = MeLeft
Me.Font = New Font(Me.Font.Style, MeFontSize)
End Sub
End Class