www.ndwl.net > VB一个题目

VB一个题目

新建一个工程,先在Form1上放置控件 如图: 代码如下: Private Sub Command1_Click()Dim Si As Integer, pDay As StringSi = -1For i = 0 To Lst_cs.ListCount - 1If Lst_cs.Selected(i) = True ThenSi = iExit ForEnd IfNextIf Si = -1 ThenMs...

dim a(-3 to 0)定义数组下标从-3到0,也就是下标为-3,-2,-1,0 LBound(a,1)取数组a的下标下限,也就是-3 UBound(a,1)取数组a的下标上限,也就是0 那么For I=LBound(a,1)To UBound(a,1)等同于for i=-3 to 0 到这你应该能看懂整个程序了。

试题一: Private Sub Command1_Click() Text1.Text = "" If Option1.Value Then Text1.Text = Text1.Text + "先生爱好:" + vbCrLf Else Text1.Text = Text1.Text + "女生爱好:" + vbCrLf End If If Check1.Value = 1 Then Text1.Text = Text1...

Private Sub Form_Click() Dim s As String, i As Integer, n As Integer s = InputBox("input your str...", , "abCDEf") For i = 1 To Len(s) Select Case (Mid(s, i, 1)) Case "a" To "z" n = n + 1 End Select Next MsgBox "character:" & n...

Option Base 1这句定义数组下标从1开始, 则x=array(10, 12, 21, 32, 24)后,x(1)=10, x(2)=12,,,x(5)=24,那么执行过程d=d-c=0-10=-10, d=d+x(2)=-10+12=2,d=d+x(3)=2+21=23, d=d+x(4)=23+32=55,d=d-c=55-32=23

你这个代码不完整,下面没法看,不知道 你想要什么样的答案,你这代码里没有可以添加的地方,再说这么难的题你多少加点分呀。

1.用VB编程序设计一个简易的计算器 代码: Dim num_1, num2, flagPrivate Sub Command1_Click(Index As Integer) Select Case Index Case 0 To 9 Label1.Caption = Label1.Caption + CStr(Command1(Index).Caption) Case 10 Label1.Caption = La...

Private Type utQuestion Description As String '问题描述 Option(2) As String '备选答案 Answer As Integer '正确答案的序号(0-2) End Type Dim Questions(19) As utQuestion, id As Integer, answer As Integer Private Sub Form_Load() D...

Private Sub Text1_KeyPress(KeyAscii As Integer)If Len(Text1.Text) > 15 ThenText2.Text = Text2.Text & Chr(KeyAscii)KeyAscii = 0Text2.SelStart = Len(Text2.Text)Text2.SetFocusEnd IfEnd Sub

Dim jg As Integer, bjg As Integer, s As Integer Private Sub Command1_Click() Dim a(10) As Integer Randomize For i = 1 To 10 a(i) = CInt(InputBox("请输入第" & i & "个学生的成绩:")) If a(i) >= 60 Then jg = jg + 1 Else bjg = bjg ...

网站地图

All rights reserved Powered by www.ndwl.net

copyright ©right 2010-2021。
www.ndwl.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com