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 remove the form close button( not to disable)?

How to remove the form close button( not to disable)?

Scheduled Pinned Locked Moved C#
tutorialquestion
11 Posts 6 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.
  • L lovnin

    How to remove the form close button( not to disable)? And only display MaximizeBox and MinimizeBox. Thinks~~

    P Offline
    P Offline
    Parwej Ahamad
    wrote on last edited by
    #2

    [Message Deleted]

    L 1 Reply Last reply
    0
    • L lovnin

      How to remove the form close button( not to disable)? And only display MaximizeBox and MinimizeBox. Thinks~~

      M Offline
      M Offline
      MarkB777
      wrote on last edited by
      #3

      Hi, Have a read of this this thread. Mark.

      D 1 Reply Last reply
      0
      • M MarkB777

        Hi, Have a read of this this thread. Mark.

        D Offline
        D Offline
        Denver Thomas
        wrote on last edited by
        #4

        try this this.ControlBox=false ;

        M 1 Reply Last reply
        0
        • D Denver Thomas

          try this this.ControlBox=false ;

          M Offline
          M Offline
          MarkB777
          wrote on last edited by
          #5

          He wants to keep the max and min buttons - Disabling the control box will get rid of all the buttons and the form icon. To be honest I don't see why he would want to remove the close button, he would be better off catching the form close event and doing what he wants to do there. Mark.

          L 1 Reply Last reply
          0
          • L lovnin

            How to remove the form close button( not to disable)? And only display MaximizeBox and MinimizeBox. Thinks~~

            D Offline
            D Offline
            DaveyM69
            wrote on last edited by
            #6

            It can't be done AFAIK. You can disable it, remove the Close menu (and separator) from the system menu and handle Alt+F4 - but that's as close as you can get. You could create your own control class that has this functionality but it would be a LOT of work to just make a button invisible when it can be disabled with little effort.

            Dave

            1 Reply Last reply
            0
            • L lovnin

              How to remove the form close button( not to disable)? And only display MaximizeBox and MinimizeBox. Thinks~~

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #7

              Hmmm... someone asked that just a month ago: http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=2436995&tid=2436667[^]

              D L 2 Replies Last reply
              0
              • P PIEBALDconsult

                Hmmm... someone asked that just a month ago: http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=2436995&tid=2436667[^]

                D Offline
                D Offline
                DaveyM69
                wrote on last edited by
                #8

                Well remembered! For the OP: In my article here[^] I have demontrated this and the removal of the close + separator from the system menu.

                Dave

                1 Reply Last reply
                0
                • M MarkB777

                  He wants to keep the max and min buttons - Disabling the control box will get rid of all the buttons and the form icon. To be honest I don't see why he would want to remove the close button, he would be better off catching the form close event and doing what he wants to do there. Mark.

                  L Offline
                  L Offline
                  lovnin
                  wrote on last edited by
                  #9

                  Thank you for your answer :-D ~

                  1 Reply Last reply
                  0
                  • P PIEBALDconsult

                    Hmmm... someone asked that just a month ago: http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=2436995&tid=2436667[^]

                    L Offline
                    L Offline
                    lovnin
                    wrote on last edited by
                    #10

                    good~ I will see that. Thank you for your answer.

                    1 Reply Last reply
                    0
                    • P Parwej Ahamad

                      [Message Deleted]

                      L Offline
                      L Offline
                      lovnin
                      wrote on last edited by
                      #11

                      I will try it. Thank you for your answer~

                      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