改变大小用Me.Width和Me.Height就行了,楼主想问的是允许用户改变无边框窗体的大小吧?
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
SetWindowLong(Me.Handle, GWL_STYLE, style)
End Sub
End Class
设置主窗体Opacity属性为0,FormBorderStyle属性为None,ShowInTaskbar属性为 False,这样窗体将在启动后隐藏.在窗体上放置一个NotifyIcon组件NotifyIcon1,一个ContextMenu(弹出菜单)组件 ContextMenu1,并根据需要为ContextMenu1添加菜单项.
form窗体有一个属性是startposition,把它设置为centerscreen就是居中.
代码为
me.startposition
=
formstartposition.centerscreen.
如果是非要计算分辨率的话:
my.computer.screen.bounds.width
是分辨率中的宽度
my.computer.screen.bounds.height
是分辨率中的高度
那么
me.top
(my.computer.screen.bounds.height
-
me.height)
/
me.left
(my.computer.screen.bounds.width
me.width)
就是让窗体居中啦~
'通过timer控件控制窗口从右下角上升显示
Private?Sub?Timer1_Tick(ByVal?sender?As?Object,?ByVal?e?As?System.EventArgs)?Handles?Timer1.Tick
Me.Top?=?My.Computer.Screen.WorkingArea.Height?-?(Me.Height?*?intCnt?*?0.1)
intCnt?+=?1
If?intCnt?10?Then
Timer1.Stop()
intCnt?=?1
End?If
End?Sub
以上就是土嘎嘎小编为大家整理的vb.net窗体右下角相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!