thanks,
Muki
There is one simple one of doing it. You have to make the form be maximized,
not to appear in the taskbar, no name that will appear in the menu and
finally no close-, maximize- or minimize button. This will, performed
correctly, result in a form that are in full screen mode.
ControlBox=False
FormBorderStyle=FixedSingle
MaximazeBox=False
MinimazeBox=False
ShowInTaskbar=False
Text=
WindowState=Maximized
I hope I didn't forget any thing.
Magnus
"Muki Rapp" <ra...@notalvision.com> wrote in message
news:uWRyRA7WBHA.1904@tkmsftngp03...
uh, in fact you should write some native code....
in Csgl: http://csgl.sourceforge.net there is a CsGL.OpenGL.ScreenForm
wich is full screen with even in an another definition !!
any way here is the trick:
--------- ScreenForm.cs ----------
public class ScreenForm : Form
{
[DllImport("csogl")]
internal static extern void DMLeaveFullScreen();
[DllImport("csogl")]
internal static extern string DMEnterFullScreen(int width, int height, int
bpp);
internal int width, height, bpp;
/// <summary>
/// init a ScreenForm with a given width, height and bpp (bit-per-pixel)
/// value. the creation is always a succes (<- improve this).
/// but set the Visible property to true could fail if these value
/// are unaccessible on your system.
/// </summary>
public ScreenForm(int aWidth, int aHeight, int aBpp)
{
width = aWidth;
height = aHeight;
bpp = aBpp;
FormBorderStyle = FormBorderStyle.None;
Size = new Size(width, height);
}
protected override void Dispose(bool b)
{
Visible = false;
base.Dispose(b);
}
private static BorderLayout layout = new BorderLayout();
/// only take size of desktop...
protected override void SetBoundsCore(int x, int y, int aWidth, int
aHeight, BoundsSpecified specified)
{
base.SetBoundsCore(0, 0, width, height, specified);
}
/// swap full screen mode
protected override void SetVisibleCore(bool val)
{
if(val) {
string err = DMEnterFullScreen(width, height, bpp);
if(err != null)
throw new OpenGLException(err);
Size = new Size(width, height);
if(main != null) {
Controls.Clear();
Controls.Add(main);
// main.Dock = DockStyle.Fill;
layout.DoLayout(this);
main.Visible = true;
}
base.SetVisibleCore(true);
}
else {
base.SetVisibleCore(false);
DMLeaveFullScreen();
}
}
/// the main component, tiled to fit the bounds.
protected Control main;
/// <summary>
/// set the control which is actually displayed. tile it to fit
/// the entire view.
/// </summary>
public virtual Control Control
{
get { return main; }
set {
main = value;
if(Visible) {
Controls.Clear();
Controls.Add(main);
// main.Dock = DockStyle.Fill;
layout.DoLayout(this);
main.Visible = true;
}
}
}
}
}
----------- csogl.c -------------------
// fullscreen management....
void DMLeaveFullScreen()
{
ChangeDisplaySettings(NULL,0);
ShowCursor(TRUE);
}
#define CASEX(x) case x: return #x;
char * DMEnterFullScreen(int width, int height, int bpp)
{
DEVMODE dmScreenSettings; // Device Mode
memset(&dmScreenSettings,0,sizeof(dmScreenSettings)); // Makes Sure Memory's Cleared
dmScreenSettings.dmSize=sizeof(dmScreenSettings); // Size Of The Devmode Structure
dmScreenSettings.dmPelsWidth = width;
// Selected Screen Width
dmScreenSettings.dmPelsHeight = height;
// Selected Screen Height
dmScreenSettings.dmBitsPerPel = bpp;
// Selected Bits Per Pixel
dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets
Rid Of Start Bar.
switch(ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN))
{
case DISP_CHANGE_SUCCESSFUL:
ShowCursor(FALSE);
return NULL;
CASEX(DISP_CHANGE_RESTART);
CASEX(DISP_CHANGE_BADFLAGS);
CASEX(DISP_CHANGE_FAILED);
CASEX(DISP_CHANGE_BADMODE);
CASEX(DISP_CHANGE_NOTUPDATED);
}
return "Unknown error while changing screen resolution";
}
-------------------------------------------