InputBox függvény

A párbeszédablakban megjelenít egy részt, amelyben a felhasználó megadhatja a bemeneti szöveget. A bemenet hozzárendelődik egy változóhoz.

Az InputBox utasítás egy kényelmes módszer a szöveg párbeszédablakon keresztüli megadására. Erősítse meg a bemenetet az OK gombra történő kattintással vagy a Return billentyű megnyomásával. A bemenetet a rendszer a függvény visszatérési értékeként adja vissza. Ha a Mégse gombbal zárja be a párbeszédablakot, akkor az InputBox nulla hosszúságú karakterláncot ("") ad vissza.

Szintaxis:


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

Paraméterek:

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.

Visszatérési érték:

String (karakterlánc)

Példa:


Sub ExampleInputBox
Dim sText As String
    sText = InputBox ("Kérjük, adjon meg egy kifejezést:","Kedves felhasználó")
    MsgBox ( sText , 64, "A kifejezés megerősítése")
End Sub

Támogasson minket!