I'm writing an application which runs automatically when Windows starts and I want make it fullscreen but without taskbar and Start button. I also want disable red button (x) for shutting form in upper right corner of the screen. Could somebody post source code in C# for this tasks. I'll be greatfull, because I'm not very experienced in C#.

Making It Fullscreen
ChrisGoodyear
In Form properties:
FormBorderStyle = none
TScott
using
System.Runtime.InteropServices;namespace
WindowsApplication1{
public partial class Form1 : Form{
private const int MF_BYPOSITION = 0x400; private const int MF_REMOVE = 0x1000; private const int MF_DISABLED = 0x2;[
DllImport("user32.Dll")] public static extern IntPtr RemoveMenu(int hMenu, int nPosition, int wFlags);[
DllImport("User32.Dll")] public static extern IntPtr GetSystemMenu(int hWnd, bool bRevert);[
DllImport("User32.Dll")] public static extern IntPtr GetMenuItemCount(int hMenu);[
DllImport("User32.Dll")] public static extern IntPtr DrawMenuBar(int hwnd); public Form1(){
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e){
DisableCloseButton(
this.Handle.ToInt32());}
public void DisableCloseButton(int hWnd){
IntPtr hMenu; IntPtr menuItemCount; //Obtain the handle to the form's system menuhMenu = GetSystemMenu(hWnd,
false); // Get the count of the items in the system menumenuItemCount = GetMenuItemCount(hMenu.ToInt32());
// Remove the close menuitemRemoveMenu(hMenu.ToInt32(), menuItemCount.ToInt32() - 1, MF_DISABLED | MF_BYPOSITION);
// Remove the SeparatorRemoveMenu(hMenu.ToInt32(), menuItemCount.ToInt32() - 2, MF_DISABLED | MF_BYPOSITION);
// redraw the menu barDrawMenuBar(hWnd);
}
}
}
Damian B
anyway
tweduk
here`s your code.. for maximizing window
private void Form1_Load(object sender, EventArgs e)
{
this.WindowState=FormWindowState.Maximized
}
and for the x button..
i dont really know how to do that.. but you can cancel the x button operation..
on the form1_closing event put this code
e.Cancel