www.ndwl.net > VB编程题目

VB编程题目

Private Sub Form_Load()Text1.FontSize = 10End SubPrivate Sub command1_click()Text1.FontSize = 10 + Int(Rnd * 3 + 1)End SubPrivate Sub command2_click()Text1.FontSize = 10 - Int(Rnd * 3 + 1)End SubPrivate Sub command3_click()Text...

第一题: 运行条件:form1上面有3个控件,文本框text1,内容代表n,文本框text2,内容代表x,按钮command1,执行计算 Option Explicit Private Sub Command1_Click() MsgBox cal(Me.Text1, Me.Text2) End Sub Function cal(ByVal n As Integer, ByVal x ...

Private Sub Command2_Click()Text1.Text = Val(Text3.Text) / Val(Text2.Text)End SubPrivate Sub Command1_Click()Text3.Text = Val(Text1.Text) * Val(Text2.Text)End SubPrivate Sub Command3_Click()Text3.Text = ""Text1.Text = ""Text2.T...

窗体上加一个按钮,完整代码如下: Option Explicit Private Type Record MyName As String * 1 MyAve As Single End Type Private Sub Command1_Click() Dim d(20, 5) As Integer Dim x As Integer Dim i As Integer Dim j As Integer Dim EvrA...

'略微有些难度Private Sub command1_click()Dim X As StringDim brrDim a As LongDim b As LongX = InputBox("请输入2个整数(以英文逗号分隔):", "交换变量", "例如:3,344", 1000, 1000)brr = Split(X, ",") If UBound(brr) > 1 ThenMsgBox "...

Private Sub Command1_Click() Dim H As Integer, L As Integer For i = 1 To 35 For j = 1 To 35 If 4 * i + j * 2 = 100 Then Print "兔子的数量是" & i & "只,鸡的数量是" & j & "只" End If Next j Next iEnd Sub

Private Sub Command1_Click()Dim i As Integer, j As IntegerFor i = -4 To 4Print Spc(3 + Abs(i)); String(2 * (4 - Abs(i)) + 1, "*")NextEnd Sub

Private Sub Form_Load() Dim a(1 To 6, 1 To 6) As Integer Me.AutoRedraw = True For i = 1 To 6 For j = 1 To 6 If i = j Then a(i, j) = 0 ElseIf i < j Then a(i, j) = 1 Else a(i, j) = 2 End If Next j, i For i = 1 To 6 For j = 1 To 6...

'这题目对初学者,其实很有难度,运行效果如下Private Sub command1_click()Dim X As StringDim brrDim a As LongDim b As LongDim c As LongX = InputBox("请输入3个整数(以英文逗号分隔):", "求最大数", "例如:3,344,51", 1000, 1000)brr = ...

Private Sub Command1_Click() If Len(Text1) >= 2 Then Text1 = Left(Text1, 2) End If End Sub Private Sub Command2_Click() Text1 = "" End Sub Private Sub Form_Load() Label1.Caption = "新字符串" Command1.Caption = "左边2个字符" Co...

网站地图

All rights reserved Powered by www.ndwl.net

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