ForumKalbi.Com

ForumKalbi.Com (https://www.forumkalbi.com/index.php)
-   Bilgisayar (https://www.forumkalbi.com/forumdisplay.php?f=220)
-   -   C# Kapat butonunu pasifleştirmek (https://www.forumkalbi.com/showthread.php?t=4652)

Candres 27 Ocak 2024 18:57

C# Kapat butonunu pasifleştirmek
 
C# Kapat butonunu pasifleştirmek
Uygulamanızın menu çubuğunda bulunan (X) kapat butonunu pasifleştirmek


Kod:

private const int SC_CLOSE = 0xF060;
private const int MF_GRAYED = 0x1;

[DllImport("user32.dll")]
private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);

[DllImport("user32.dll")]
private static extern int EnableMenuItem(IntPtr hMenu, int wIDEnableItem, int wEnable);

private void Form1_Load(object sender, System.EventArgs e)
{
EnableMenuItem(GetSystemMenu(this.Handle, false), SC_CLOSE, MF_GRAYED);
}


Forum saati; Türkiye'ye göre ayarlanmış olup, şu an saat: 07:38.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Navbar with Avatar by Motorradforum