Method GetTextFromUser
GetTextFromUser(string?, string?, string?, Control?, int, int, bool)
Pop up a dialog box with title set to caption
,
message
, and a defaultValue
.
The user may type in text and press OK to return this text, or press Cancel
to return the empty string.
public static string? GetTextFromUser(string? message, string? caption, string? defaultValue = null, Control? parent = null, int x = -1, int y = -1, bool centre = true)
Parameters
message
stringDialog message.
caption
stringDialog title.
defaultValue
stringDefault value. Optional.
parent
ControlParent control. Optional.
x
intX-position on the screen. Optional. By default is -1.
y
intY-position on the screen. Optional. By default is -1.
centre
boolIf
true
, the message text (which may include new line characters) is centred; iffalse
, the message is left-justified.