VB6中,使用PICTRUEBOX或IMAGE控件,如何让加载在其中的小图片拉伸至整个屏幕大小(当然不覆盖窗体边框、菜单栏、工具栏和状态栏的空间)。
解决方案 »
- vb 把access中每行数据输出时调用自定义函数?
- webbrowser控件的事件中的参数postdata怎样使用?
- 最后40分急求一简单答案:winsock的udp协议如何传送数组?
- 急!!!制作安装文件出错,恳请大侠的援助(在线等)
- 一个小问题,急!!!
- 我用VC写了个DLL,其中有一个自定义结构.请问如何在VB中调用.(详内)
- 急等结果: 用VB里的DataReport控件时的问题
- 从数据库中读取少量的信息有没有简便的方法?
- 如何获取webbrowser中某个对象的全部代码?
- HELP!!!!!!!!!!!加100分!!!!!
- winsock.getdata返回的数据,求解码
- word表格换行问题
Image1.Stretch = True
Image1.Move 0, 0, Screen.Width, Screen.Height
End Sub
Image1.Stretch = True
End SubPrivate Sub Form_Resize()
Image1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub
Private Sub Picture1_Paint()
Picture1.PaintPicture TmpPic, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
End Sub
Private Sub Form_Load()
Set TmpPic = LoadPicture("d:\a.jpg")
End Sub
Private Sub Form_Resize()
Picture1.Move 0, 0, Me.Width, Me.Height
Call Picture1_Paint
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set TmpPic = Nothing
End Sub
Private Sub Form_Load()
Picture1.AutoRedraw = True
Me.WindowState = 2
End SubPrivate Sub Form_Resize()
Picture1.Move 0, 0, Me.Width, Me.Height
Picture1.PaintPicture ImageList1.ListImages(1).Picture, 0, 0, Me.Width, Me.Height
End Sub
在 Form_Resize()事件 中处理就行。固定大小的窗体可以在 Form_Load() 中处理。
0,0是XY座标位置(我可不知道你上面那些工具栏的宽高), 与后面两个参数是宽高度, 自己定.
Option Explicit
Private Sub Form_Load()
Me.Width = Screen.Width
Me.Height = Screen.Height
Me.AutoRedraw = True
Me.Move 0, 0
End SubPrivate Sub Form_Click()
Me.PaintPicture Picture1.Picture, 0, 0, Me.ScaleWidth, Me.ScaleHeight
Picture1.Move Screen.Width
End Sub