vb.net 如果输入框更大 [英] vb.net if inputbox is greater

查看:18
本文介绍了vb.net 如果输入框更大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在检查输入是少于 3 个字符还是少于 3 个字符时遇到问题.我应该使用 if 语句还是 while 循环?.

I'm having trouble checking if input is less then or grater 3 characters. should i use if statement or while loop?.

以及如何在输入框输入后将所有数据存储在列表框中:

and also how to store all the data in listbox after inputbox entered:

For Num = 1 To CInt(nudPassengers.Value)
    Dim userName As String
    if userName < 3 then
    InputBox("Whats your name? " & Num)
    Dim infoForm As New frmBooking
    infoForm.lstItinerary.Items.Add(userName)
    end if
Next

推荐答案

少于 3 个字符

 If Username.Length < 3 Then

 End If

  • 字符串操作
  • 字符串
  • 这篇关于vb.net 如果输入框更大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆