Įvedimo langelio funkcija

Dialogo lange pateikiamas raginimą, kuriame vartotojas gali įvesti tekstą. Įvestis priskiriama kintamajam.

KomandaĮvedimo langelis – tai patogus būdas įvesti tekstą naudojantis dialogu. Patvirtinkite įvestį spustelėdami Gerai arba paspausdami reikšmę grąžinančią funkciją. Įvestis grąžinama taip, kaip funkcija grąžina reikšmę. Jei užversite dialogo langą naudodami atšaukimo komandą, Įvedimo langelis grąžins nulinio ilgio eilutę ("").

Sintaksė:


InputBox (Prompt As String[, Title As String[, Default As String[, xpostwips As Integer, ypostwips As Integer]]]) As String

Parametrai:

prompt: String expression displayed as the message in the dialog box.

title: String expression displayed in the title bar of the dialog box.

default: String expression displayed in the text box as default if no other input is given.

xpostwips: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of LibreOffice.

ypostwips: Integer expression that specifies the vertical position of the dialog. The position is an absolute coordinate and does not refer to the window of LibreOffice.

If xpostwips and ypostwips are omitted, the dialog is centered on the screen. The position is specified in twips.

Grąžinimo reikšmė:

Eilutė

Pavyzdys:


Sub ExampleInputBox
Dim sText As String
    sText = InputBox ("Prašome įvesti frazę:","Gerbiamas vartotojau")
    MsgBox ( sText , 64, "Frazės patvirtinimas")
End Sub

Paremkite mus!