怎么用vb做一个简单的程序
设计一程序,当程序运行后,在窗体的正中间显示“”你好,请输入你的姓名”,当用户输入姓名并单击窗“”确定”后,在窗体中用黑体,三号,红色显示,xx同学,你好,祝你学好vb程...
设计一程序,当程序运行后,在窗体的正中间显示“”你好,请输入你的姓名”,当用户输入姓名并单击窗“”确定”后,在窗体中用黑体,三号,红色显示,xx同学,你好,祝你学好vb程序设计”,同时窗体上出现两个命令按钮“”继续”,结束”,如果单击继续,则又回到初始运行状态,单击结束按钮即结束程序运行
展开
7个回答
展开全部
加入标签Label1,Caption设置为“你好,请输入你的姓名”
加入文本框Text1,用来输入姓名的
加入标签Label2,按照你的要求设置字体属性,autosize属性设成true
分别加入确定,继续,结束按钮
以下是代码:
Private Sub Form_Load()
Me.结束.Visible = False
Me.继续.Visible = False
Label2.Visible = False
End Sub
Private Sub 继续_Click()
Me.结束.Visible = False
Me.继续.Visible = False
Label2.Visible = False
Me.确定.Visible = True
Label1.Visible = True
Text1.Visible = True
End Sub
Private Sub 结束_Click()
End
End Sub
Private Sub 确定_Click()
Label2.Caption = Text1.Text & "同学,你好,祝你学好vb程序设计"
Me.结束.Visible = True
Me.继续.Visible = True
Label2.Visible = True
Label1.Visible = False
Text1.Visible = False
Me.确定.Visible = False
End Sub
加入文本框Text1,用来输入姓名的
加入标签Label2,按照你的要求设置字体属性,autosize属性设成true
分别加入确定,继续,结束按钮
以下是代码:
Private Sub Form_Load()
Me.结束.Visible = False
Me.继续.Visible = False
Label2.Visible = False
End Sub
Private Sub 继续_Click()
Me.结束.Visible = False
Me.继续.Visible = False
Label2.Visible = False
Me.确定.Visible = True
Label1.Visible = True
Text1.Visible = True
End Sub
Private Sub 结束_Click()
End
End Sub
Private Sub 确定_Click()
Label2.Caption = Text1.Text & "同学,你好,祝你学好vb程序设计"
Me.结束.Visible = True
Me.继续.Visible = True
Label2.Visible = True
Label1.Visible = False
Text1.Visible = False
Me.确定.Visible = False
End Sub
追问
倒数第七八程序不对啊,显示无效字符
追答
原来能上传附件了,自己看看吧
展开全部
Private Sub Command1_Click()
With Me
.FontName = "黑体"
.FontSize = 15.75
.ForeColor = vbRed
End With
Print Text1 & "同学,你好,祝你学好vb程序设计"
Command2.Visible = True
Command3.Visible = True
End Sub
Private Sub Command2_Click()
Command2.Visible = False
Command3.Visible = False
Cls
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Command1.Caption = "确定"
With Command2
.Visible = False
.Caption = "继续"
End With
With Command3
.Visible = False
.Caption = "结束"
End With
With Text1
.Left = (Me.ScaleWidth - .Width) / 2
.Top = (Me.ScaleHeight - .Height) / 2
.Text = "同学,你好,祝你学好vb程序设计"
End With
End Sub
With Me
.FontName = "黑体"
.FontSize = 15.75
.ForeColor = vbRed
End With
Print Text1 & "同学,你好,祝你学好vb程序设计"
Command2.Visible = True
Command3.Visible = True
End Sub
Private Sub Command2_Click()
Command2.Visible = False
Command3.Visible = False
Cls
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Command1.Caption = "确定"
With Command2
.Visible = False
.Caption = "继续"
End With
With Command3
.Visible = False
.Caption = "结束"
End With
With Text1
.Left = (Me.ScaleWidth - .Width) / 2
.Top = (Me.ScaleHeight - .Height) / 2
.Text = "同学,你好,祝你学好vb程序设计"
End With
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim w
Private Sub Command1_Click()
Command1.Visible = False
Command2.Visible = True
Command3.Visible = True
w = Trim(Text1.Text)
Text1.Text = w & "同学,你好,祝你学好vb程序设计"
Text1.FontSize = "15" '修改字体大小
Text1.FontName = "黑体"
Text1.ForeColor = vbRed
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Command1.Visible = True
Command2.Visible = False
Command3.Visible = False
End Sub
Private Sub Form_Load()
Text1.Text = "你好,请输入你的姓名"
End Sub
Private Sub Command1_Click()
Command1.Visible = False
Command2.Visible = True
Command3.Visible = True
w = Trim(Text1.Text)
Text1.Text = w & "同学,你好,祝你学好vb程序设计"
Text1.FontSize = "15" '修改字体大小
Text1.FontName = "黑体"
Text1.ForeColor = vbRed
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Command1.Visible = True
Command2.Visible = False
Command3.Visible = False
End Sub
Private Sub Form_Load()
Text1.Text = "你好,请输入你的姓名"
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
先加载窗体上的各种控件,然后进入写代码可以从最简单的加法器做起
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
别人写好的程序,你是不可以直接访问的,都加了壳,你只能反汇编~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询