[VB.NET]改变窗口大小

前端之家收集整理的这篇文章主要介绍了[VB.NET]改变窗口大小前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
改变窗口大小 在窗口没有窗体边框和标题栏的情况下 怎样改变窗口大小 能有拖动的功能吗? 如果里面有个pictureBox ,怎样可以让 pictureBox 里面的图片也随之改变大小? __________________________________________________________________________ 设置 pictureBox.anchor=Top,Bottom,left,right __________________________________________________________________________ 设置pictureBox的Dock属性为fill. __________________________________________________________________________ 1、拖动:添加API函数 SendMessage和ReleaseCapture,可以拖动 Declare Function SendMessage Lib user32 Alias SendMessageA ( _ ByVal hwnd As IntPtr,_ ByVal wMsg As Integer,_ ByVal wParam As Integer,_ ByVal lParam As Integer) _ As Boolean Declare Function ReleaseCapture Lib user32 Alias ReleaseCapture () As Boolean Const WM_SYSCOMMAND = &H112 Const SC_MOVE = &HF010& Const HTCAPTION = 2 Private Sub Form1_MouseDown(ByVal sender As Object,_ ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles MyBase.MouseDown ReleaseCapture() SendMessage(Me.Handle,WM_SYSCOMMAND,SC_MOVE + HTCAPTION,0) End Sub 2、改变窗口大小让 pictureBox 里面的图片也随之改变大小用楼上的方法应该可以。 __________________________________________________________________________

猜你在找的VB相关文章