Start a main form maximized without covering the taskbar

630 views
Skip to first unread message

Benj Nunez

unread,
May 12, 2009, 2:30:46 AM5/12/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hello experts,

I've been googling for tips on how to start a main form already
maximized without
covering the taskbar (no success so far). I want to do the opposite of
what's been
discussed here:

http://stackoverflow.com/questions/118130/c-why-wont-a-fullscreen-winform-app-always-cover-the-taskbar


Any ideas?


Thanks in advance.



Benj

CallMeLaNN

unread,
May 12, 2009, 6:28:39 AM5/12/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Without covering the taskbar?
it is a normal maximize and not fullscreen.
So whats the prob?

In the form property, set the WindowsState Maximized.

If you plan to set the location and size manually in code, make sure
StartPosition is set to Manual.

On May 12, 2:30 pm, Benj Nunez <benjnu...@gmail.com> wrote:
> Hello experts,
>
> I've been googling for tips on how to start a main form already
> maximized without
> covering the taskbar (no success so far). I want to do the opposite of
> what's been
> discussed here:
>
> http://stackoverflow.com/questions/118130/c-why-wont-a-fullscreen-win...

Benj Nunez

unread,
May 12, 2009, 8:40:02 PM5/12/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I've seen some code in other sites that distinguishes between
"maximized" and "full screen". With "full screen"
being able to cover the taskbar which is very effective indeed,
especially when you intend to run your program in a kiosk. :)

Anyway, I think I got the answer after inserting this line of code
under the form's load event:


private void Form_Load(object sender, EventArgs e)
{
//For this to work, ensure that the Form has its :
// StartPosition = Manual and WindowsState = Normal

this.Width = Screen.PrimaryScreen.WorkingArea.Width;
this.Height = Screen.PrimaryScreen.WorkingArea.Height;

CallMeLaNN

unread,
May 12, 2009, 11:46:06 PM5/12/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
OIC, you want to do it fullscreen.

Sure you need to do it manually coz standard Form does not have
property to do fullscreen.

Based on experience, I know most programmer including me don't see
that StartPostion need to set to Manual when we want to change
Location in form Load. Since you no need to set the Location in form
Load, not necessary to set StartPosition to Manual.

As u give the solution, yes it was easy just set the size of the form.
In addition you can make the FormBorderStyle = None to make it fully
fullscreen without titlebar.

Benj Nunez

unread,
May 13, 2009, 8:50:51 PM5/13/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Noted. Thanks! :)


Benj
Reply all
Reply to author
Forward
0 new messages