Click here to Skip to main content
13,051,809 members (46,062 online)
Click here to Skip to main content
Add your own
alternative version


27 bookmarked
Posted 10 Oct 2006

Show a WinForm in FullScreen mode using C#

, 16 Apr 2008
Rate this:
Please Sign up or sign in to vote.
This article contents source code and demo show how to set your WinForm in Full screen mode


I have read some articles about FullScreen mode in WinForm using C#. Per example this one on codeproject with the name "Full Screen mode in C#". This example was not satisfized me. I have develope another one and i thing it can be really better, depend of your project!


The source code contents two zip files, the first one is the source code for the FullScreenMode.dll and the second is a test programm to improve the full screen mode on a WinForm. You have to build the associated FullScreenMode project to get a new FullScreenMode.dll. There is one FullScreenMode.dll in the demo file. In the Demo programm, you can only press F11 to view the Form in Full screen mode. Pressed F11 again will reset to the normal Form.


The most important in the HandleTaskBar class is to show or hide the Windows taskbar using WinAPI (user32.dll). The methods showTaskBar() and hideTaskBar() will show or hide the TaskBar depend of the screen mode. The methods FindWinDow() and SetWindowPos() must be defined.

/// <span class="code-SummaryComment"><summary></span>

/// Show the TaskBar.

/// <span class="code-SummaryComment"></summary></span>

public static void showTaskBar()


     int hWnd = FindWindow("Shell_TrayWnd", "");

     SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW);


/// <span class="code-SummaryComment"><summary></span>

/// Hide the TaskBar.

/// <span class="code-SummaryComment"></summary></span>

public static void hideTaskBar()


      int hWnd = FindWindow("Shell_TrayWnd", "");

      SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW);


The source code is very easy to understand.

But any suggestion will be welcome.




This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
Germany Germany
.Net, C#, VB Development

You may also be interested in...


Comments and Discussions

SuggestionPer my test, it's better not to hide/unhide the form Pin
Leon Zeng20-Jun-14 21:14
memberLeon Zeng20-Jun-14 21:14 
GeneralThis is Great!!! Pin
tonymark0915-Jun-10 23:37
membertonymark0915-Jun-10 23:37 
GeneralUnable to unzip it! Pin
yudyzhao14-Apr-08 1:02
memberyudyzhao14-Apr-08 1:02 
GeneralRe: Unable to unzip it! Pin
S.Captive7-Jun-09 7:54
memberS.Captive7-Jun-09 7:54 
GeneralThanks for you help Pin
JackChen198718-Oct-07 15:44
memberJackChen198718-Oct-07 15:44 
Generalzip file unreadable Pin
m_s_t22-Sep-07 11:09
memberm_s_t22-Sep-07 11:09 
GeneralRe: zip file unreadable Pin
Adiphe22-Sep-07 22:03
memberAdiphe22-Sep-07 22:03 
QuestionDifference? Pin
termi10-Oct-06 4:37
membertermi10-Oct-06 4:37 
AnswerRe: Difference? Pin
Adiphe10-Oct-06 4:43
memberAdiphe10-Oct-06 4:43 
GeneralRe: Difference? Pin
termi10-Oct-06 19:47
membertermi10-Oct-06 19:47 
GeneralRe: Difference? Pin
Adiphe11-Oct-06 0:04
memberAdiphe11-Oct-06 0:04 
GeneralRe: Difference? Pin
termi11-Oct-06 4:44
membertermi11-Oct-06 4:44 
AnswerRe: Difference? [modified] Pin
Adiphe11-Oct-06 5:15
memberAdiphe11-Oct-06 5:15 
GeneralRe: Difference? Pin
Hercules011-Apr-09 0:00
memberHercules011-Apr-09 0:00 
GeneralRe: Difference? Pin
Adiphe1-Apr-09 6:47
memberAdiphe1-Apr-09 6:47 
Generalerrate links Pin
MrBabba10-Oct-06 4:33
memberMrBabba10-Oct-06 4:33 
GeneralRe: errate links Pin
Adiphe10-Oct-06 5:01
memberAdiphe10-Oct-06 5:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 16 Apr 2008
Article Copyright 2006 by Adiphe
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid