救命VB问题?

来源:百度知道 编辑:UC知道 时间:2024/06/14 06:01:28
VB问题
设计一个按扭是放大的
但放大到一定程度就不能再放大
请问这程序该怎么编写?
补充一点
不是按扭变大,是窗体变大!!!!

窗体放大
Private Sub command1_Click()
If Form1.Width < 5000 And Form1.Height < 5000 Then
Form1.Width = Form1.Width + 100
Form1.Height = Form1.Height + 100
End If
End Sub
上面的5000就是限定放大的尺度的,可以自己改改

Private Sub Command1_Click()
If Me.Width>15270 Then Exit Sub
Me.Top = 0
Me.Left = 0
Me.Width = Me.Width + 1000
Me.Height = Me.Height + 1000
End Sub

如果Me.Width>=15270,就不会放大了

'按钮放大:
Private Sub command1_Click()
If Command1.Height > 1000 Then Exit Sub
Command1.Height = Command1.Height + 100
Command1.Width = Command1.Width + 100
End Sub
'窗体放大:
Private Sub command1_Click()
If me.Height > 6000 Then Exit Sub
me.Height = me.Height + 100
Me.Width = Me.Width + 100
End Sub