VB.NET改变无框窗体大小
请快啊,最好是API,不要VB6,不要VB6不要VB6不要VB6!是VB.NET!是VB.NET!是VB.NET!是VB.NET!是VB.NET!...
请快啊,最好是API,不要VB6,不要VB6不要VB6不要VB6!是VB.NET!是VB.NET!是VB.NET!是VB.NET!是VB.NET!
展开
4个回答
展开全部
改变大小用Me.Width和Me.Height就行了,楼主想问的是允许用户改变无边框窗体的大小吧?
Public Class Form1
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Int32, ByVal nIndex As Int32) As Int32
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Int32, ByVal nIndex As Int32, ByVal dwNewLong As Int32) As Int32
Private Const GWL_STYLE As Int32 = -16
Private Const WS_THICKFRAME As Int32 = &H40000
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Dim style As Int32 = GetWindowLong(Me.Handle, GWL_STYLE) Or WS_THICKFRAME
SetWindowLong(Me.Handle, GWL_STYLE, style)
End Sub
End Class
Public Class Form1
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Int32, ByVal nIndex As Int32) As Int32
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Int32, ByVal nIndex As Int32, ByVal dwNewLong As Int32) As Int32
Private Const GWL_STYLE As Int32 = -16
Private Const WS_THICKFRAME As Int32 = &H40000
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Dim style As Int32 = GetWindowLong(Me.Handle, GWL_STYLE) Or WS_THICKFRAME
SetWindowLong(Me.Handle, GWL_STYLE, style)
End Sub
End Class
展开全部
方法有两种:一:你可以在Fom1(默认)的属性框里找到 Size属性,改变里面的数字就OK了;
二,可以直接用鼠标在Form1窗体右下角拖动,即可调整大小。
若你要让调试后的窗体全屏,找到Form1的Windowstate属性改成Maximizd。
我的回答希望对你有帮助~
二,可以直接用鼠标在Form1窗体右下角拖动,即可调整大小。
若你要让调试后的窗体全屏,找到Form1的Windowstate属性改成Maximizd。
我的回答希望对你有帮助~
更多追问追答
追问
是无框窗体
追答
设置窗体的controlbox属性为false,设置窗体的FormBorderStyle 属性为Sizable,就可以改变窗体大小了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
改变无框窗体大小?改变Size属性不就行了吗?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询