VB.net 如何按中心放大控件
来源:百度知道 编辑:UC知道 时间:2024/09/22 09:42:14
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.PictureBox1.Width += 1
Me.PictureBox1.Height += 1
'Me.PictureBox1.Left -= 1 //原本以为写这两句代码就可以使其按中心放大,结果却不行
'Me.PictureBox1.Top -= 1
If Me.PictureBox1.Width >= 80 Or Me.PictureBox1.Height >= 80 Then Timer1.Enabled = False
End Sub
求救中,哪位好心人帮忙解答一下!
Dim old_myform_width As Single
Dim old_myform_height As Single
Dim new_myform_width As Single
Dim new_myform_height As Single
Dim x_scale As Single
Dim y_scale As Single
Private Sub myform_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
new_myform_width = MyBase.Size.Width
new_myform_height = MyBase.Size.Height
x_scale = new_myform_width / old_myform_width
y_scale = new_myform_height / old_myform_height
old_myform_width = new_myform_width
old_myform_height = new_myform_height
Dim mycontrol As New Control
For Each mycontro