InputBox Function

Prujazuje dijalog gdje korisnik kuca. input je kao varijabla

The InputBox izraz je dobra metoda za unosenje teksta kroz dijalog. potvrdi unos klikajuci ok ili Return. input je vracen kao funkcija. ako zatvorite dijalog sa Cancel, InputBox vraca string koji nij eprazan ("").

Sintaksa:


InputBox (Msg As String[, Title As String[, Default As String[, x_pos As Integer, y_pos As Integer]]]])

Vrati vrijednost:

Stringovi

Parametar:

Msg: String expression displayed as the message in the dialogue box.

Naslov: String expression displayed in the title bar of the dialogue box.

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

x_pos: Integer expression that specifies the horizontal position of the dialogue box. The position is an absolute coordinate and does not refer to the window of the office application.

y_pos: Integer expression that specifies the vertical position of the dialogue box. The position is an absolute coordinate and does not refer to the window of the office application.

ako x_pos and y_pos are omitted, the dialogue box is centred on the screen. The position is specified in twips.

Primjer:


Sub ExampleInputBox
Dim sText As String
    sText = InputBox("Please enter a phrase:", "Dear User")
    MsgBox(sText, 64, "Confirmation of phrase")
End Sub

Please support us!