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
  1. Home
  2. General Programming
  3. C#
  4. how to disable Close button of windows form using C#.Net

how to disable Close button of windows form using C#.Net

Scheduled Pinned Locked Moved C#
csharpjsonhelptutorialquestion
3 Posts 3 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.
  • K Offline
    K Offline
    koolprasad2003
    wrote on last edited by
    #1

    hello frnds, i am using C#.Net 2.0 window based application. i want to disable Windows close button. how can do that ??? any API ??? please help. thankx in advance koolprasad2003 :) Be a good listener...Because Opprtunity knoughts softly...N-Joy

    G N 2 Replies Last reply
    0
    • K koolprasad2003

      hello frnds, i am using C#.Net 2.0 window based application. i want to disable Windows close button. how can do that ??? any API ??? please help. thankx in advance koolprasad2003 :) Be a good listener...Because Opprtunity knoughts softly...N-Joy

      G Offline
      G Offline
      Gopal S
      wrote on last edited by
      #2

      Hi, You can use FormClosing event for disable the close button. private void Form1_FormClosing(object sender, FormClosingEventArgs e) { e.Cancel = true; } Please let me know if this help you. Thanks, Gopal.S

      Gopal.S

      1 Reply Last reply
      0
      • K koolprasad2003

        hello frnds, i am using C#.Net 2.0 window based application. i want to disable Windows close button. how can do that ??? any API ??? please help. thankx in advance koolprasad2003 :) Be a good listener...Because Opprtunity knoughts softly...N-Joy

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

        You need PInvoke for that. Check this[^]

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia 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