Article Search
困った時はまず記事を検索
Sponsored Link
トップ > サンプル > Visual Basic 6.0 (VB6) > テキストボックス (TextBox) > テキストの文字数を取得する
VB6 では、Text プロパティに対して、Len 関数を使用します。
以下にサンプルコードを示します。
' テキストの文字数を格納する変数を宣言する Dim iLength As Integer ' テキストの文字数を取得する iLength = Len(Me.Text1.Text) ' 取得したテキストの文字数を表示する Call MsgBox(CStr(iLength))