改变有图片背景的Form大小时,Form发生闪烁,请教如何消除闪烁现象?
步骤:
1.创建新工程
2.添加Image控件,属性 Stretch=True
picture = app.path & "\sy4.bmp"
3.编写代码。为使图片随窗口的大小改变而改变,编写如下代码:
Private Sub Form_Load()
Image1.Width = Me.Width / Screen.TwipsPerPixelY
Image1.Height = Me.Height / Screen.TwipsPerPixelX
End Sub Private Sub Form_Resize()
Image1.Width = Me.Width / Screen.TwipsPerPixelY
Image1.Height = Me.Height / Screen.TwipsPerPixelX
End Sub
4. 运行。
当改变窗口的大小时,窗口发生闪烁现象:
步骤:
1.创建新工程
2.添加Image控件,属性 Stretch=True
picture = app.path & "\sy4.bmp"
3.编写代码。为使图片随窗口的大小改变而改变,编写如下代码:
Private Sub Form_Load()
Image1.Width = Me.Width / Screen.TwipsPerPixelY
Image1.Height = Me.Height / Screen.TwipsPerPixelX
End Sub Private Sub Form_Resize()
Image1.Width = Me.Width / Screen.TwipsPerPixelY
Image1.Height = Me.Height / Screen.TwipsPerPixelX
End Sub
4. 运行。
当改变窗口的大小时,窗口发生闪烁现象:
Private Sub Form_Activate()
Image1.Width = Me.Width / Screen.TwipsPerPixelY
Image1.Height = Me.Height / Screen.TwipsPerPixelX
ENDSUB
里也加代码