Sijin
Thu Sep 09 01:01:52 CDT 2004
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
Dian wrote:
> 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
>
>
>
> "Sijin Joseph" <sijinNOSPAMdotnet@hotmail.com> wrote in message
> news:OX0yn9vkEHA.3016@tk2msftngp13.phx.gbl...
>
>>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
>>
>>
>>
>>Dian wrote:
>>
>>>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 !!!
>>>
>>>
>>>
>>>
>>>"Sijin Joseph" <sijinNOSPAMdotnet@hotmail.com> wrote in message
>>>news:e5Rt92kkEHA.324@TK2MSFTNGP11.phx.gbl...
>>>
>>>
>>>>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
>>>>
>>>>
>>>>
>>>>Dian wrote:
>>>>
>>>>
>>>>>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 ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>
>