菜鸟问题.....请问VB.NET怎么设置窗口位置啊?
不能像VB6.0那样直接拖位置了
我像设置在屏幕右下方
在窗口属性那里的Location怎么改也没效果
只有改StartPosition才改得到起始位置
但选项只有那么几个,并没有设置到屏幕右下方的选项
求教.........
[解决办法]
Dim screenWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width Dim screenHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height Me.Left = screenWidth - Me.Width Me.Top = screenHeight - Me.Height
[解决办法]
Dim frm As New Form frm.StartPosition = FormStartPosition.Manual '这个很重要,必须设置为Manual,Location才能有用 Dim StartPoint As New System.Drawing.Point StartPoint.X = System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Width - frm.Width StartPoint.Y = System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Height - frm.Height frm.Location = StartPoint frm.Show()