帮忙写个简单的VB代码,谢谢啦

作者&投稿:乾莺 (若有异议请与网页底部的电邮联系)
VB简单写一下代码~

Option Explicit
Dim i As Integer
Private Sub Form_Click()

i = i + 1
If i > 4 Then Exit Sub


End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If i = 1 Then
text1.Text = X
End If
If i = 2 Then
text11.Text = X - text1.Text
End If
If i = 3 Then
text2.Text = X
End If
If i = 4 Then
text22.Text = X - text2.Text
text22.Text = text22.Text / 10
textR.Text = text11.Text / text22.Text
End If
End Sub

Private Sub Command1_Click()
If Check1.Value + Check2.Value + Check3.Value = 0 Then Exit Sub
Text1.Text = "我喜欢的科目是"
If Check1.Value = 1 Then Text1.Text = Text1.Text & Check1.Caption
If Check2.Value = 1 Then Text1.Text = Text1.Text & Check2.Caption
If Check3.Value = 1 Then Text1.Text = Text1.Text & Check3.Caption
End Sub

Private Sub Form_Load()
Check1.Caption = "语文"
Check2.Caption = "数学"
Check3.Caption = "英语"
Text1.Text = ""
End Sub

Private Sub Form_Click()
Dim x As Integer, y As Integer, z As Integer, 水仙花数 As Integer
For x = 1 To 9
For y = 0 To 9
For z = 0 To 9
水仙花数 = x * 100 + y * 10 + z
If 水仙花数 = x ^ 3 + y ^ 3 + z ^ 3 Then
Print 水仙花数
End If
Next
Next
Next
End Sub

所有就是 已经有的 + 现在的
text1= text1.text & N

可以用换行 vbcrlf
用空格 spn( 空格数)

三位数水仙花数,如图




帮我写个简单的VB代码 谢谢
If Check1.Value + Check2.Value + Check3.Value = 0 Then Exit Sub Text1.Text = "我喜欢的科目是"If Check1.Value = 1 Then Text1.Text = Text1.Text & Check1.Caption If Check2.Value = 1 Then Text1.Text = Text1.Text & Check2.Caption If Check3.Value = 1 Then Text1....

高手帮忙做几个简单VB程序,奖重金!
窗体1:两个command,三个text,三个label,代码如下:Const pi = 3.14 Dim r, l, s As Double Private Sub Command1_Click()r = Val(Text1.Text)l = 2 * pi * r Text2.Text = l s = pi * r * r Text3.Text = s End Sub Private Sub Command2_Click()Form1.Hide Form2.S...

VB简易程序设计代码
Inihao ...先写这么多 - - 先睡觉去了。。。明儿再说!

Vb写一个代码,
Dim a(24, 3) As Integer Private Sub Command1_Click()Dim i As Integer, j As Integer, k As Integer, temp As Integer '数组按左高右低排序 For i = 0 To 24 For j = 0 To 3 For k = j + 1 To 3 If a(i, j) < a(i, k) Then temp = a(i, j): a(i, j) =...

VB简易计算器代码怎么写
Dim a100 As Double Private Sub cmd1_Click()If Plus = True Then Plus = False Text1.Text = "1"Else Text1.Text = Text1.Text & "1"End If End Sub Private Sub cmd2_Click()If Plus = True Then Plus = False Text1.Text = "2"Else Text1.Text = Text1.Text & "2"End ...

帮我写段VB代码
0 End Function Private Sub Form_Load()Me.Show DoLoop = False Set oControl = Controls.Add("VB.Timer", "MyTimer") '动态添加一个Timer控件 oControl.Interval = 200 '设置间隔为200 MyMain '开始运行 End Sub

求做一个最简单的vb计算公式程序的代码
一、设置控件属性 text1(被除数):text=(空)label1:caption=“\/”text2(除数):text=(空)label2:caption=“=”text3(商):text=(空)command1:caption=“计算”command2:caption=“清空”二、编写代码 Private Sub Command1_Click()Dim a As Single,b As Single,c As Single a=Val...

帮忙设计个VB的代码
Dim a, b, c, d As Double For a = 0 To Text1.Text b = Text1.Text - a If Text2.Text = 4 * a + 2 * b Then c = a d = b End If Next If c = 0 And d = 0 Then MsgBox ("其重新输入结果")Else MsgBox "兔有" & c & "只,鸡有" & d & "只。", , ...

VB 编写一个简单程序,要求:单击命令按钮来显示或隐藏标签,具体点的解答...
打开vb新建一个工程,保存好 窗体上画一个一个命令按钮command1(命令按钮标题“隐藏”),一个标签label1,标签最好打几个字 双击命令按钮进入代码编辑器 写如下代码:if command1.caption='隐藏' then label1.visible=false command1.caption='显示'else label1.visible=true command1.caption='隐藏...

做两个VB程序 简单题目
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 = Label1.Caption + "." Case 1...

孟津县17810613155: vb的最简单代码 -
翠阎布洛: 插入三个文本框a1、a2、a3来接收输入的三个数,插入一个按钮a4来执行操作,最后用三个文本框来显示结果.Private Sub a4_Click()Dim v1, v2, v3, t As Singlev1 = a1.Valuev2 = a2.Valuev3 = a3.Value...

孟津县17810613155: 求一个简单的vb程序代码 -
翠阎布洛: 控件:shape两个,timer1个 Private Sub Timer1_Timer() Static a, b If Shape2.Lefta = 15 End If If Shape2.Topb = 15 End If If Shape2.Left >= Shape1.Width + Shape1.Left - Shape2.Width Then a = -15 End If If Shape2.Top >= Shape1.Height + ...

孟津县17810613155: 求一个简单的VB程序
翠阎布洛: 代码如下: Dim x As String Private Sub Form_Load() Timer1.Interval = 1000 x = "1.jpg" End Sub Private Sub Timer1_Timer() a: If Left(x, 1) < 10 Then Picture1.Picture = LoadPicture("e:\" & x) Else x = "1.jpg" GoTo a End If x = Left(x, 1) + 1 & ".jpg" End Sub

孟津县17810613155: 求一个VB简单程序代码 -
翠阎布洛: 以下程序可以运行,添加5个文本框用于显示,一个按钮.Private Sub Command1_Click() Dim val(1 To 60) As Integer Dim pass%, good%, i%, j%, temp%, sum%'输入60个学生的成绩 For i = 1 To 60 val(i) = InputBox("输入第" & i & "个学生的...

孟津县17810613155: 求编写超简单VB代码,快来啊 -
翠阎布洛: Private Sub Form_Load() Timer1.Interval = 500 End Sub Private Sub Timer1_Timer() If Form1.WindowState = 1 Then Form2.Show End If End Sub 添加一个Timer控件,有什么不懂的可以问我.QQ596606277

孟津县17810613155: 求 VB 的一个简单代码 -
翠阎布洛: Private Sub Command1_Click() If Command1.Caption = "关闭游戏" Then Command1.Caption = "开启游戏" Else Command1.Caption = "关闭游戏" End If End Sub Private Sub Form_Load() Command1.Caption = "关闭游戏" End Sub

孟津县17810613155: 求一个简单VB的编程代码
翠阎布洛: 在窗体上画三个文本框一个按钮. Private Sub Command1_Click() Dim szAnimals, szConstellation, arDate, d As Date Dim nYear As Integer, nMonth As Integer, nDay As Integer arDate = Array(22, 19, 20, 20, 21, 21, 23, 23, 23, 23, 22, 22) ...

孟津县17810613155: 告诉我一些简单的vb编程代码 -
翠阎布洛: uEnd是用户定义捕捉VB输出框(MsgBox)按下按钮事件一个变量.即你的原代码 MsgBox "您确定要离开吗?", vbYesNo + vbQuestion, "离开程序"执行按vbYes或vbNo按钮的结果...

孟津县17810613155: 那位电脑高手帮我写个超简单的VB编码啊,急用,谢了啊!! -
翠阎布洛: Private Sub Command1_Click()Dim chengji As IntegerIf Text1.Text <> "请输入成绩!" Thenchengji = CInt(Text1.Text)If chengji >= 9...

孟津县17810613155: 求比较简单的VB程序 -
翠阎布洛:Private Sub Form_Load() TextY.Text = Year(Date) TextM.Text = Month(Date) TextD.Text = Day(Date) LabelW.Caption = Mid("日一二三四五六", Weekday(Date), 1) End Sub Private Sub Command1_Click() Dim myYear, myMonth, myDay...

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网