Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Disabling the close button on a form

Disabling the close button on a form

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rajiya
    wrote on last edited by
    #1

    Hi, In my asp.net application, i am opening a child window.I want to disable the close button on the title bar. Does anyone knw how to go about in doing it. Thanks, Riz Riz

    C 1 Reply Last reply
    0
    • R Rajiya

      Hi, In my asp.net application, i am opening a child window.I want to disable the close button on the title bar. Does anyone knw how to go about in doing it. Thanks, Riz Riz

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      You can't.


      Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website

      N 1 Reply Last reply
      0
      • C Colin Angus Mackay

        You can't.


        Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website

        N Offline
        N Offline
        N a r e s h P a t e l
        wrote on last edited by
        #3

        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); }

        Naresh Patel

        N 1 Reply Last reply
        0
        • N N a r e s h P a t e l

          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); }

          Naresh Patel

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          :confused: Read question clearly please. It is for ASP.NET not desktop application


          My Website | Ask smart questions

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups