|
-
Mar 28th, 2006, 11:41 PM
#1
Thread Starter
Member
[RESOLVED] [2.0] Fill entire screen with a form control
Hi folks:
I have a form called VideoForm and i would like to fill the entire screen with the form (without any borders or taskbar). Is it that possible? If so... HOW?
Another question... can I send the content of that form to a secondary monitor?
Please help me with this stuff. I used to program with classic VB and doing a form full screen with VB was easy (BorderStyle = 0, MaximizeWindow) but i don't know how to do the same in C# (.NET).
Thank you in advance.
Best regards,
Andy
Last edited by Hack; Mar 29th, 2006 at 10:46 AM.
Reason: Added green "resolved" checkmark
-
Mar 28th, 2006, 11:56 PM
#2
Re: [2.0] Fill entire screen with a form control
Would you be surprised to learn that it's virtually the same:
Code:
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
As for the secondaty monitor, you can use the Screen class to get information about displays, so you can set the location of the form so that it is on the secondary display before maximising it.
Code:
foreach (Screen scr in Screen.AllScreens)
{
// Find the first non-primary screen.
if (!scr.Primary)
{
// Position the form on that screen.
this.Location = new Point(scr.Bounds.Left, scr.Bounds.Top);
break;
}
}
// Make the form full screen.
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
-
Mar 29th, 2006, 01:20 AM
#3
Thread Starter
Member
Re: [2.0] Fill entire screen with a form control
Thank you so much. With two screens, the code works perfectly.
But if used with just one screen, when the form gets maximized, the task bar is still visible no matter what I do.
Is this a known issue? Is there any way to fix that?
Thank's again.
Andy
-
Mar 29th, 2006, 01:32 AM
#4
Thread Starter
Member
Re: [2.0] Fill entire screen with a form control
Sorry! I made a mistake. Everything works fine now.
Anyways, do you know how can I get the screens count before entering the foreach?
So the program decide whether to put the video form in the primary or secondary screen according to screens count? (if one... place in primary... if two... place in secondary...)
-
Mar 29th, 2006, 01:39 AM
#5
Re: [2.0] Fill entire screen with a form control
AllScreens is an array so you can just check its Length property.
-
Mar 29th, 2006, 08:54 AM
#6
Thread Starter
Member
Re: [2.0] Fill entire screen with a form control
Thank you. You are the best
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
|