设计一个窗体,窗体的标题为“VB程序设计”,运行程序时单击窗体在窗体上输出“VB程序设计”

设计一个窗体,窗体的标题为“VB程序设计”,运行程序时单击窗体在窗体上输出“VB程序设计”,同时窗体的标题变为“欢迎你的到来",窗体的长、宽同时减少10TWIP。求高!

第1个回答  推荐于2017-11-25
Dim x As Integer

Private Sub Form_Click()
If x = 0 Then
x = x + 1
Me.Caption = "欢迎你的到来"
Me.Width = 4700
Me.Height = 3500
Label1.Caption = "VB程序设计"
Else
x = 0
Call Form_Load
End If
End Sub

Private Sub Form_Load()
Me.Caption = "VB程序设计"
Me.Width = 4800
Me.Height = 3600
Label1.Caption = ""
End Sub追问

Me.Width = 4700
Me.Height = 3500
If x = 0 Then
x = x + 1
这些事什么意思啊?

追答

原来的界面大小是4800*3600,你不是缩小100吗?就是4700*3500了。

Private Sub Form_Click()
If x = 0 Then '判断X是不是0,如果是执行下面代码
x = x + 1
Me.Caption = "欢迎你的到来"
Me.Width = 4700
Me.Height = 3500
Label1.Caption = "VB程序设计"
Else '如果不是0,执行下面代码
x = 0
Call Form_Load
End If
End Sub

本回答被提问者采纳
第2个回答  2013-05-20
Private Sub Form_Load()
Me.Caption = "VB程序的设计"
Me.Width = 9000
Me.Height = 9000
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MsgBox "VB程序设计"
Me.Caption = "欢迎你的到来"
Me.Width = Me.Width - 10
Me.Height = Me.Height - 10
End Sub

追问

Form1.Width = Form1.Width - 10
Form1.Height = Form1.Height - 10和 Mw.Width=9000有区别么?
那个9000是什么意思?

追答

初始化me的高度与宽度。如果感觉不明显,你可以把10改成100就会明显一点了,不然一次减10不明显。