kwrl.net
当前位置:首页 >> VB程序制作一个成绩等级程序,要求在文本框TExt1中... >>

VB程序制作一个成绩等级程序,要求在文本框TExt1中...

Private Sub Command1_Click() If Text1.Text = "" Then MsgBox "请输入成绩", vbInformation, "提示" Text1.SetFocus Exit Sub End If If IsNumeric(Text1.Text) = False Then MsgBox "你输入的不是数字,请重新输入", vbInformation, "提示" T...

Option ExplicitPrivate Sub Command1_Click() Dim renshu%, i%, n$, f! Text1.Text = "" Text1.MultiLine = True renshu% = Val(InputBox("请输入学生的个数", "提示")) For i% = 1 To renshu% n$ = InputBox("请输入第" & Str(i%) & "个学生的...

Private Sub Command1_Click() Dim s As Integer s = Val(Text1.Text) If s > 90 Then Print "优秀" ElseIf s > 80 And s 70 And s = 60 And s

Private Sub Form_Click() Dim n As Integer If IsNumeric(Text1.Text) Then n = Val(Text1.Text) Select Case n Case 0 Text2.Text = "Sunday" Case 1 Text2.Text = "Monday" Case 2 Text2.Text = "Tuesday" Case 3 Text2.Text = "Wednesday" C...

用循环迭代一加,然后除以个数不就行了? 你没有说明平均成绩到底录入到哪里去了,是变量数组?数据库?还是什么,没法写代码。 好吧,假设成绩都存到了数组CJ里面, 另外假设你的按钮框Name属性为'求平均值',文本框Name属性为'平均成绩'。 把...

Dim i As Integer '定义整数i Private Sub Form_Click() '开始窗体的单击过程 i = i + 1 '修改i的内容 Text1.Text = i '将文本框的内容换成在该窗口上鼠标单击的次数 End Sub '结束本过程

Private Sub Command1_Click() Dim a As Long a = Val(Text1.Text) + Val(Text2.Text) MsgBox "a的值是" & a End SubPrivate Sub Form_Load() Text1.Text = "" Text2.Text = "" End Sub

假定输入成绩的文本框是Text1,输出结果的文本框是Text2,查询按钮是Command1。学分由于没有给出计算方法,这里就不考虑了。 Private Sub Command1_Click()Dim cj As Integer, dj As Stringcj = Val(Text1.Text)If CStr(cj) Text1.Text Then dj ...

用strreverse函数。 举个例子: MsgBox StrReverse("ABC") 结果:CBA

Private Sub Command1_Click() Dim sz As Integer, zm As Integer For I = 1 To Len(Text1.Text) Select Case Mid(Text1.Text, I, 1) Case "A" To "Z", "a" To "z" zm = zm + 1 Case "0" To "9" sz = sz + 1 End Select Next I Text2.Text = "字...

网站首页 | 网站地图
All rights reserved Powered by www.kwrl.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com