添加listbox1,label1,command1
创新互联是一家从事企业网站建设、做网站、网站建设、行业门户网站建设、网页设计制作的专业网站设计公司,拥有经验丰富的网站建设工程师和网页设计人员,具备各种规模与类型网站建设的实力,在网站建设领域树立了自己独特的设计风格。自公司成立以来曾独立设计制作的站点数千家。
Public Class Form1
Dim N(10) As Integer
'生成随机数
Private Sub CreatRand()
Dim I As Integer
Dim Strarr As String
Strarr = ""
ListBox1.Items.Clear()
Dim R As New System.Random
For I = 0 To 9
N(I) = R.Next(30, 100)
ListBox1.Items.Add(Str(N(I)))
Strarr = Strarr Str(N(I)) " "
Next
'添加标签的横向数字序列
Label1.Text = Strarr
End Sub
'获取最大值
Private Function GetMax() As Integer
Dim I As Integer
Dim intMax As Integer
intMax = 0
For I = 0 To 9
intMax = IIf(intMax N(I), intMax, N(I))
Next
Return intMax
End Function
'获取最小值
Private Function GetMin() As Integer
Dim I As Integer
Dim intMin As Integer
intMin = 101
For I = 0 To 9
intMin = IIf(intMin N(I), intMin, N(I))
Next
Return intMin
End Function
'获取平均值
Private Function GetAve() As Single
Dim I As Integer
Dim Sum As Integer
Sum = 0
For I = 0 To 9
Sum = Sum + N(I)
Next
Return Sum / 10
End Function
'生成随机数,显示各种值
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call CreatRand()
MsgBox("最大值=" Str(GetMax()) ",最小值=" Str(GetMin()) ",平均值=" Str(GetAve()))
End Sub
End Class
input type="text" maxlength="11" /这是控制最大输入字数至于不能少于11个字,需要在点击保存按钮时,通过.length来控制
要改成这样;
for i = 1 to Len(s)
j = Mid(s,i,1)
select case j
case "a" to "z","A" to "Z"
C = C + 1
CASE "0" TO "9"
D = D + 1
CASE ELSE
M= M+1
END SELECT
NEXT
标题名称:vb.net数字个数 vb字符个数
文章URL:https://www.cdcxhl.com/article22/hggecc.html
成都网站建设公司_创新互联,为您提供ChatGPT、网页设计公司、网站排名、企业建站、虚拟主机、App开发
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联