Skip to main content
GameDev.net gamedev.net
🔒 Locked

Windows Forms fullscreen application

Started by psyho Aug 14, 2004 at 12:13 PM 1 replies 5.1k views
Original Post
psyho
psyho
Is there any way to run C# Windows Forms application in fullscreen mode (no title bar and borders)? I'm searching for a solution which doesn't use Direct3D, OpenGL, etc. just plain Windows Forms code.
______Adam 'Psyho' Pohorecki
Onemind
Onemind
I'm assuming you mean forms made in the GUI dialog designer. No, there is not a way of telling a form to be full screen, but you can do it programatticly. First create a window the size of the screen (see GetSystemMetrics()). Make the window a popup window, and set the extended properties to "ALWAYS ON TOP."
Daos
Daos
DEVMODE dmScreenSettings;  memset(&dmScreenSettings,0,sizeof(DEVMODE));  dmScreenSettings.dmSize=sizeof(dmScreenSettings);  dmScreenSettings.dmPelsWidth=width;  dmScreenSettings.dmPelsHeight=height;  dmScreenSettings.dmBitsPerPel=bits;//16,24,32  dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|                             DM_PELSHEIGHT;  if(ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL)  {/*an error bla bla.....your video card is ....*/}*to return to the previus settings use:ChangeDisplaySettings(NULL,0);


check out link

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.