How can i make a form go on full screen?
on the form, make the borderstyle 0 - None
then on the form, make the windowstate 2 - Maximized
that will bring you to a complete full screen
or you could have the borderstyle 0 - None
and on Form_Load() have Form1.WindowState = 2
Eh, that's not really fullscreen, that's more "taking up the entire screen assuming all of the other applications want to play fair."
Well if you put it that way, I guess the only way would be to use DirectX :).
Making a window cover the entire screen is the way you normally do fullscreen. MSN sometimes pops up over fullscreen games - if applications don't want to play fair, they'll probably find a way to put themselves on top.
There's a command or window property or something that makes it so you can't click off the form, and nothing is on top of the form... I just don't remember the command sorry maybe someone who knows more will know.
Are you thinking of WS_EX_TOPMOST?
That doesn't seem right, I think it was an actual property of the window... Forgot it though.
It would be helpful to know what you're trying to achieve (is this to be a full-screen game, or a nag-screen, or what?)
If it's for a game, then this is the code my D3DCore class uses for setting fullscreen... I'm not sure how it would look in VB, but it might help you:
if(fullscreen && m_bWindowed)
{
//First adjust window style to remove title bars etc.
SetWindowLong(m_hWnd, GWL_STYLE, WS_POPUP|WS_SYSMENU|WS_VISIBLE);
//First try a simple adapter reset
D3DDISPLAYMODE adaptermode;
if(m_pD3D != NULL)
{
if( FAILED(m_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &adaptermode)) )
return ERR_COREFAILURE;
m_d3dpp.Windowed = false;
m_d3dpp.BackBufferHeight = adaptermode.Height;
m_d3dpp.BackBufferWidth = adaptermode.Width;
m_d3dpp.FullScreen_RefreshRateInHz = adaptermode.RefreshRate;
if( ! FAILED(m_pDevice->Reset(&m_d3dpp)) )
{
SetWindowPos(m_hWnd, HWND_TOP, 0, 0, adaptermode.Width, adaptermode.Height, 0);
m_bWindowed = false;
Pause(false);
return 1;
}
else return ERR_DEVICENOTRESET;
}
else return ERR_COREFAILURE;
}
I know you just did not post MFC code on this forum. >:(
You're correct.... I didnt :P
thx for all ye rhelp... i was looking for a fullscreen on a regular form.
i got it now....
No worries.
Once thing I'm curious about though..... DM, what made you think that was MFC code?
It's actually the D3D9 API, but I'm interested to know how you drew that conclusion.
Quotem_
I always get suspicious of possible MFC infections when I see that.