.NETGURU
Form Real FullScren Question
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.windowsforms.

Post a new message to this list...

Dian
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 ?

Reply to this message...
 
    
Sijin Joseph
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:
[Original message clipped]

Reply to this message...
 
    
Dian
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" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Sijin Joseph
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:
[Original message clipped]

Reply to this message...
 
    
Dian
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" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Sijin Joseph
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:
[Original message clipped]

Reply to this message...
 
    
lukasz
[Original message clipped]

OnActivate, OnDeactive

[Original message clipped]

override default application exception

Reply to this message...
 
 
System.Drawing.Point
System.EventArgs
System.Threading.Thread
System.Windows.Forms.FormBorderStyle
System.Windows.Forms.Screen




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification