|
-
Mar 26th, 2009, 02:48 PM
#1
Thread Starter
Fanatic Member
FormBorderStyle to None when maximizing the form...
Argh! This is driving me nuts!
I have a normal form (FormBorderStyle = Sizeable).
When the user maximizes the form, the form's border should disappear and fully cover the screen. Like so:
vb Code:
Private Sub frmVideo_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged If Me.WindowState = FormWindowState.Maximized Then 'Remove border Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None 'Bring to front Me.TopMost = True End If End Sub
Problem is, when the form gets maximized and border changed to None, the form doesn't cover the whole screen.
The form gets the same height as when it is maximized with a titlebar on top. So, the form is about 20 pixels too short, leaving most of the Windows taskbar uncovered.
So, apparently, if the FormBorderStyle changes after the form has maximized, the change in size is not corrected.
Therefore, my question is: How do I change a form's size when it's maximized or how do I change the FormBorderStyle before maximization is finished?
Thanks for any help!
Alexander.
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|