请问我在VB中怎样才能让文本框的大小随窗体大小改变?
答案:1 悬赏:0
解决时间 2021-12-31 18:53
- 提问者网友:世勋超人
- 2021-12-31 10:01
请问我在VB中怎样才能让文本框的大小随窗体大小改变?
最佳答案
- 二级知识专家网友:琴狂剑也妄
- 2021-12-31 10:26
Dim tx As Single, ty As Single
Private Sub Form_Load()
tx = Text1.Width / Me.Width
ty = Text1.Height / Me.Height
End Sub
Private Sub Form_Resize()
If Me.WindowState <> vbMinimized Then
Text1.Width = tx * Me.Width
Text1.Height = ty * Me.Height
End If
End Sub
Private Sub Form_Load()
tx = Text1.Width / Me.Width
ty = Text1.Height / Me.Height
End Sub
Private Sub Form_Resize()
If Me.WindowState <> vbMinimized Then
Text1.Width = tx * Me.Width
Text1.Height = ty * Me.Height
End If
End Sub
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯