VB 一到很简单的题
作者&投稿:星索 (若有异议请与网页底部的电邮联系)
Private Sub Command1_Click()
Text1.Text = Int(Val(Text1.Text))
End Sub
上面的代码直接复制
下面是界面
i=10时,继续执行循环i=10+1=11,此时进行条件判断,11>10,for循环结束,i保持11的值。
Private Sub Command1_Click()Me.List2.Clear
For i = 0 To Me.List1.ListCount - 1
If Me.List1.Selected(i) = True Then
Me.List2.AddItem Me.List1.List(i)
End If
Next
End Sub
Private Sub Command2_Click()
For i = 0 To Me.List1.ListCount - 1
If Me.List1.Selected(i) = True Then
Me.List1.Selected(i) = False
End If
Next
End Sub
Private Sub Command3_Click()
Me.List2.Clear
End Sub
Private Sub Form_Load()
Me.List1.AddItem "红烧"
Me.List1.AddItem "红烧1"
Me.List1.AddItem "红烧2"
Me.List1.AddItem "红烧3"
Me.List1.AddItem "红烧4"
Me.List1.AddItem "红烧5"
End Sub
苍梧姿小儿:[答案] 给你编写一段小程序吧,供你参考. 调用方法:Call GetNewABC(a, b, c) 变量定义:Dim a, b, c As Integer Sub GetNewABC(a, b, c As Integer) If a * b
柳州市13840801271: 一道简单的VB题,求解释...设有如下程序:x=2for i=1 to 10 step2x=x+1Next运行以上程序后,x的值为()A.26B.27C.38D.57我知道这是一道很简单的题目,... - ?
苍梧姿小儿:[答案] 题目本身就存在问题: 1、如果题目是: x=2 for i=1 to 10 step 2 x=x+1 Next 则答案应为:7 2、如果题目是: x=2 for i=1 to 10 step 2 x=x+i Next 则答案应为:27
柳州市13840801271: vb简单题4.有如下程序: a=1:b=2:c=3 a=a+b:b=b+c:c=b+a If a3 Or b3 Then a=b - a:b=c - a:c=b+a End If Print a+b+c 运行后,输出的结果是_______. A)16 B)3 ... - ?
苍梧姿小儿:[答案] A
柳州市13840801271: 一道简单的VB程序题 - ?
苍梧姿小儿: 2004-3-2 10:40:11 AM 自己用VB搞一下就出来了呀~
柳州市13840801271: vb编程.很简单的一道题.?
苍梧姿小儿: Dim a() As String = TextBox1.Text.Split(VbCrlf) '按一个回车来分割字符串 Dim b() As String = TextBox2.Text.Split(" ") '按一个空格来分割字符串 TextBox3.Text = "" For i As Integer = 0 To a.Length - 1For j As Integer = 0 To b.Length - 1TextBox3.Text &= (Int(a(i)) * Int(b(j))).ToString & " "Next jTextBox3.Text &= VbCrlf Next i
柳州市13840801271: 快来帮我做一道简单的VB题!给出一个英文字母,要求按字母顺序打印出5个字母,指定的字母是五个字母中间的一个字母.例如,给定的字母为"R",应打... - ?
苍梧姿小儿:[答案] Private Sub Form_Load() Dim str As String, ascii As Integer, str2 As String str = InputBox("请随意输入一个英文字母") If Len(str) 1 Or Asc(str) 122 Then MsgBox "输入...
柳州市13840801271: 一道简单的VB题 - ?
苍梧姿小儿: Case 1 To 20 x = 10 意思就是说,如果n(text1)的值在1~20之间,那么x(text2)的值就为10.Case Is < 10 =case(n的值)小于10 其实LZ可以去把这程序做出来,更好理解 补充:text2的确是10,我试过了..原因是因为 Case 1 To 20 x = 10 是在 Case 10 x = 40 的前面 系统看的是最前面的符合条件的语句~ 也就是说,如果把 Case 1 To 20 x = 10 放到后面,那么text2就是40了
柳州市13840801271: 超简单VB编程题 - ?
苍梧姿小儿: Private Sub Form_Click() a = InputBox("请输入一个带空格的字符串") MsgBox Replace(a, " ", "") End Sub 运行后单击窗体即可.
柳州市13840801271: 几道简单的VB编程题,来个高手?
苍梧姿小儿: 呵呵,第一个 sub a() t=1 for i=1 to 10 t=t*i next i print t end sub 第二个 sub b() sum=0 for i=1000 to 200 step 2(这个是求偶数)for i=1001 to 2000 step 2( 这个是求奇数) sum=sum+i next i print sum end sub 第三个 sub c() for i= 1 to 5 print tab(2*i+10);strint (8,"*") next i end sub 完了,给个满意答案啊
柳州市13840801271: 一道简单vb编程题??
苍梧姿小儿: Private Sub Command1_Click()For a = 0 To 9For b = 0 To 9For c = 0 To 9n = a * 100 + b * 10 + cm = c * 100 + b * 10 + aIf n + m = 1333 Then Print "a=" & a & " " & "b=" & b & " " & "c=" & c Next cNext bNext aEnd Sub