Hi all, I have a following inquiry.
Here in news group I found the sample code of how to put a window form in
FullScreen (in the style VS 2003/2005 does)
protected override void OnLoad(EventArgs e)
{
base.OnLoad (e);
Point clientTL = this.PointToScreen(new Point(ClientRectangle.X,
ClientRectangle.Y));
Point clientBR = this.PointToScreen(new Point(ClientRectangle.X +
ClientRectangle.Width, ClientRectangle.Y + ClientRectangle.Height));
Point frameTL = this.Location;
Point frameBR = new Point(this.Location.X + this.Width, this.Location.Y +
this.Height);
int topXDelta = clientTL.X - frameTL.X;
int topYDelta = clientTL.Y - frameTL.Y;
int bottomXDelta = frameBR.X - clientBR.X;
int bottomYDelta = frameBR.Y - clientBR.Y;
Rectangle newFrameBounds = Screen.GetBounds(this);
newFrameBounds.Inflate(topXDelta + bottomXDelta, topYDelta +
bottomYDelta);
newFrameBounds.Location = new Point(-topXDelta, -topYDelta);
this.MaximumSize = newFrameBounds.Size;
this.MaximizedBounds= newFrameBounds;
}
But if I want that "fullscreen" behaviour to be complete how to round that
when leave "fullscreen" mode, click on maximized button of form
that from will be not in "real" maximized state - even more form will again
in "fullscreen" mode.
If anybody has any suggestions of how this is happen in VS 2003/2005 ?
Sijin Joseph - 04 Sep 2004 08:05 GMT
Look at this
http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=239628
What they are doing is hiding the title bar altogether, to get back to
normal mode there is some toolbar button or kbd shortuct which you can
handle to get back into the real maximized mode by altering the size and
resetting the titlebar.
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> Hi all, I have a following inquiry.
> Here in news group I found the sample code of how to put a window form in
[quoted text clipped - 32 lines]
>
> If anybody has any suggestions of how this is happen in VS 2003/2005 ?
Dian - 04 Sep 2004 09:59 GMT
Hi I have a look at that post but this is not solve the problem with hiding
task bar -
as I understand I must user FindWindow API call to get handle to taskbar and
after that
call ShowWindow (false) on that handle ... I think it is not very proper
solution cause you must engage showing taskbar again when form lostfocus -
(ALT+TAB was pressed as exmp)
even worst - if an unhandled excetion occurs when you are in "fullscreen"
mode who will show taskbar ?!?
I keep on thinking that the code I post previous is more robust but
incomplete ...
So I continue crying for help !!!
> Look at this
> http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=239628
[quoted text clipped - 44 lines]
> >
> > If anybody has any suggestions of how this is happen in VS 2003/2005 ?
lukasz - 04 Sep 2004 21:41 GMT
> solution cause you must engage showing taskbar again when form lostfocus -
> (ALT+TAB was pressed as exmp)
OnActivate, OnDeactive
> even worst - if an unhandled excetion occurs when you are in "fullscreen"
> mode who will show taskbar ?!?
override default application exception
Sijin Joseph - 05 Sep 2004 05:17 GMT
Hi Dian,
I was able to get back to normal mode by using these 3 lines of code
this.TopMost = false;
this.FormBorderStyle = FormBorderStyle.Sizable;
this.Activate();
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> Hi I have a look at that post but this is not solve the problem with hiding
> task bar -
[quoted text clipped - 70 lines]
>>>
>>>If anybody has any suggestions of how this is happen in VS 2003/2005 ?
Dian - 06 Sep 2004 18:53 GMT
Hi Sijin
I think that this 3 line solution would not help ...
As I see in topic here
http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=239628
we set width and height of the form ... when we come back from "fullscreen"
mode then we have wrong values for "normal" height and width don't you think
so ?
I keep on finding the secret of MS solution - I attached to VS 2003
application with Spy ++ and I was able to find what
SendMessage/RecieveMessage sequence they use .. but still no luck .. I will
inform for that soluton
> Hi Dian,
>
[quoted text clipped - 82 lines]
> >>>
> >>>If anybody has any suggestions of how this is happen in VS 2003/2005 ?
Sijin Joseph - 09 Sep 2004 07:01 GMT
Well i used this code to go full screen, see if it works for you.
this.FormBorderStyle = FormBorderStyle.None;
this.Topmost = true;
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> Hi Sijin
>
[quoted text clipped - 108 lines]
>>>>>
>>>>>If anybody has any suggestions of how this is happen in VS 2003/2005 ?