VB如何设置窗体背景图片随窗体大小自动调整?
1个回答
展开全部
改图片不是更简单么,嘿嘿
加个picture能实现滴
(不是背景)
把picture1的autoredraw的属性改为true
private
sub
command1_click()
dim
p
as
single,
pic
as
new
stdpicture
set
pic
=
loadpicture(图片路径)
if
pic.height
/
picture1.scaleheight
<
pic.width
/
picture1.scalewidth
then
p
=
picture1.scalewidth
/
pic.width
picture1.paintpicture
pic,
0,
(picture1.scaleheight
-
pic.height
*
p)
*
0.5,
picture1.scalewidth,
p
*
pic.height
else
p
=
picture1.scaleheight
/
pic.height
picture1.paintpicture
pic,
(picture1.scalewidth
-
pic.width
*
p)
*
0.5,
0,
p
*
pic.width,
picture1.scaleheight
end
if
end
sub
加个picture能实现滴
(不是背景)
把picture1的autoredraw的属性改为true
private
sub
command1_click()
dim
p
as
single,
pic
as
new
stdpicture
set
pic
=
loadpicture(图片路径)
if
pic.height
/
picture1.scaleheight
<
pic.width
/
picture1.scalewidth
then
p
=
picture1.scalewidth
/
pic.width
picture1.paintpicture
pic,
0,
(picture1.scaleheight
-
pic.height
*
p)
*
0.5,
picture1.scalewidth,
p
*
pic.height
else
p
=
picture1.scaleheight
/
pic.height
picture1.paintpicture
pic,
(picture1.scalewidth
-
pic.width
*
p)
*
0.5,
0,
p
*
pic.width,
picture1.scaleheight
end
if
end
sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询