在vb中,当单击窗体时,窗体左上角出现一张图片,什么设置代码
当单击窗体时,窗体背景左上角出现一张图片。当双击窗体时,窗体背景图像平铺显示。(提示:窗体背景图片属性:BackgroundImage,属性值为Image.FromFil...
当单击窗体时,窗体背景左上角出现一张图片。当双击窗体时,窗体背景图像平铺显示。(提示:窗体背景图片属性:BackgroundImage,属性值为Image.FromFile("路径")。背景图片布局属性:BackgroundImageLayout。)
展开
2个回答
展开全部
' VB 代码:在窗体添加Image1,并设置Picture 属性为目标图片
Private Sub Form_Click()
Form1.PaintPicture Image1.Picture, 0, 0
End Sub
Private Sub Form_DblClick()
Dim i, l As Integer, x1, y1 As Integer
x1 = Form1.Width \ Image1.Width
y1 = Form1.Height \ Image1.Height
For i = 0 To x1
For l = 0 To y1
Form1.PaintPicture Image1.Picture, Image1.Width * i, Image1.Height * l
Next
Next
End Sub
Private Sub Form_Click()
Form1.PaintPicture Image1.Picture, 0, 0
End Sub
Private Sub Form_DblClick()
Dim i, l As Integer, x1, y1 As Integer
x1 = Form1.Width \ Image1.Width
y1 = Form1.Height \ Image1.Height
For i = 0 To x1
For l = 0 To y1
Form1.PaintPicture Image1.Picture, Image1.Width * i, Image1.Height * l
Next
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询