Results 1 to 6 of 6

Thread: [RESOLVED] [2.0] Fill entire screen with a form control

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2003
    Posts
    63

    Resolved [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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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;
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2003
    Posts
    63

    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

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2003
    Posts
    63

    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...)

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Fill entire screen with a form control

    AllScreens is an array so you can just check its Length property.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 2003
    Posts
    63

    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
  •  



Click Here to Expand Forum to Full Width