XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Borderless Windowed Game

Last post 1/8/2009 3:31 PM by Bud. 2 replies.
  • 1/8/2009 4:04 AM

    Borderless Windowed Game

    Is it possible to have a Windows game that runs in a window without borders.

    I am currently setting the PreferredBackBuffer height and Width and IsFullScreen to false.

    Everything is working correctly but I can't figure out how to remove Windows borders.

    I am wanting to do something similar to how WoW allows you to run in a window maximized.

    When I run full screen on dual monitor I want to be able to debug on one monitor without it minimizing the game.


  • 1/8/2009 9:22 AM In reply to

    Re: Borderless Windowed Game

    Hi.
    I don't know if it's a proper way to do this, but it seems to work.
    In your Game.cs file in Main() function replace game.Run(); with following:

    System.Windows.Forms.Control control = System.Windows.Forms.Form.FromHandle(game.Window.Handle); 
    System.Windows.Forms.Form form = control.FindForm(); 
    form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 
    game.Run(); 

    Of course you must add reference to System.Windows.Forms in your project.
  • 1/8/2009 3:31 PM In reply to

    Re: Borderless Windowed Game

    Thanks that is a big help.
Page 1 of 1 (3 items) Previous Next