Private Sub Command1_Click()
Dim H As Single,M As Single,N As Single,T As Single
H=Text1.text
M=Text2.text
N=Text3.text
T=H/(M-N)
Label1.Caption="青蛙从高" &H "米的井中爬出需要" &T &"天"
End Sub
运行程序,在3个文本框分别世悉输入H,M和N,就可以在Label1中看到结果
Dim a, bPrivate Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Text.Text = "Visual Basic程序设计"唯仔冲
Command1.Caption = "指歼结束"
Text.Left = 0: Text.Top = 0: Text.Width = 0.5 * Form1.Width
Text.Height = 0.5 * Form1.Height
a = Form1.Width - Command1.Left
b = Form1.Height - Command1.Top
End Sub
Private Sub Form_Resize()
Text.Left = 0: Text.Top = 0: Text.Width = 0.5 * Form1.Width
Text.Height = 0.5 * Form1.Height
Command1.Left = Form1.Width - a
Command1.Top = Form1.Height - b
End Sub
注意,各变戚神量名,控件名保持一致,你题目中的文本框名称为text
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)