# SlimDX, Winforms and full-screen

This topic is 2946 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

What I can do fine: Use WinForms controls when running SlimDX in a window.

The problem: Switching to full-screen results in controls flickering between visible and invisible at a high rate of speed, or just going invisible, as they are over-written and possibly re-drawn.

The question: Is there a way to have Winforms controls display correctly in SlimDX/DirectX fullscreen (using "DirectX 9.0c")? And if so, how have other people solved it?

Thanks.

(Any incoherence can be blamed on lack of sleep. )

##### Share on other sites
Windows Forms is rendered with GDI. Using GDI and D3D over the same pixel airspace results in the problem you are observing as they both compete to render to those pixels.

The only way you can make this work is to trim up the screen real estate and allow only GDI, or only D3D, to render to the appropriate region. You cannot do this is exclusive full screen mode; you'll have to run in "full screen windowed" mode, which is just windowed mode where your main window is resized to be the dimensions of the screen (and immovable, et cetera).

##### Share on other sites

Windows Forms is rendered with GDI. Using GDI and D3D over the same pixel airspace results in the problem you are observing as they both compete to render to those pixels.

The only way you can make this work is to trim up the screen real estate and allow only GDI, or only D3D, to render to the appropriate region. You cannot do this is exclusive full screen mode; you'll have to run in "full screen windowed" mode, which is just windowed mode where your main window is resized to be the dimensions of the screen (and immovable, et cetera).

Not quite sure what you're referring to with "full screen windowed"; could you give an example, maybe some simple code?

Thanks.

Edit: To clarify: I think I do know, but "think I do know" is not the same as "know".

Edit2: Probably got it. It did seem to work ("display" is a Windows.Forms.Control, hence the conversion):

 Form d = (Form)display; d.AutoScaleMode = AutoScaleMode.Dpi; d.WindowState = FormWindowState.Maximized; d.ControlBox = false; d.MinimizeBox = false; d.MaximizeBox = false; d.ShowIcon = false; d.SizeGripStyle = SizeGripStyle.Hide; d.FormBorderStyle = FormBorderStyle.None; 

##### Share on other sites
"full screen windowed" mode, which is just windowed mode where your main window is resized to be the dimensions of the screen [/quote]

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 11
• 23
• 42
• 75