Συνάρτηση InputBox

Εμφανίζει μία ειδοποίηση στο παράθυρο διαλόγου στο οποίο ο χρήστης μπορεί να εισαγάγει κείμενο. Το κείμενο που εισάγεται εκχωρείται σε μια μεταβλητή.

Η δήλωση The InputBox είναι μία συμβατική μέθοδος για να εισαγάγετε κείμενο μέσω ενός παραθύρου διαλόγου. Επιβεβαιώστε την είσοδο κάνοντας κλικ στο κουμπί OK ή πατώντας το πλήκτρο Enter. Η είσοδος επιστρέφεται ως τιμή επιστροφής της συνάρτησης. Αν κλείσετε το παράθυρο διαλόγου με τo κουμπί Άκυρο, το InputBox επιστρέφει συμβολοσειρά μηδενικού μήκους ("").

Σύνταξη:


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

Παράμετροι:

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.

Επιστρεφόμενη τιμή:

Συμβολοσειρά

Παράδειγμα:


Sub ExampleInputBox
Dim sText As String
    sText = InputBox ("Εισαγάγετε μια φράση:","Αγαπητέ χρήστη")
    MsgBox ( sText , 64, "Επιβεβαίωση φράσης")
End Sub