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. General Programming
  3. Visual Basic
  4. How to disable the Close titlebar button ?

How to disable the Close titlebar button ?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
6 Posts 4 Posters 1 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
    Ky Nam
    wrote on last edited by
    #1

    I want to remove Close button only , not system menu & minimize/maximize buttons Thanks

    S I K 3 Replies Last reply
    0
    • K Ky Nam

      I want to remove Close button only , not system menu & minimize/maximize buttons Thanks

      S Offline
      S Offline
      Senthil S
      wrote on last edited by
      #2

      Hi, I thing this is not possible of removing close button. Because the form loaded by means of inherit from the form class. But we use control box said to be False n Remove all text in text in the Text Properties. Which will remove close button n Max n min buttons also. Then it is batter to create of ur own of Max n Min button...

      Senthil S Software Engineer

      K C 2 Replies Last reply
      0
      • K Ky Nam

        I want to remove Close button only , not system menu & minimize/maximize buttons Thanks

        I Offline
        I Offline
        i gr8
        wrote on last edited by
        #3

        In Form Closing Event place the code e.cancel=true prabumj Prabumj@gmail.com

        1 Reply Last reply
        0
        • S Senthil S

          Hi, I thing this is not possible of removing close button. Because the form loaded by means of inherit from the form class. But we use control box said to be False n Remove all text in text in the Text Properties. Which will remove close button n Max n min buttons also. Then it is batter to create of ur own of Max n Min button...

          Senthil S Software Engineer

          K Offline
          K Offline
          Ky Nam
          wrote on last edited by
          #4

          Thank you for your reply I don't use Form , I want to disable Close button of any window in system , using Window Style flags Among all Window Style flags , I find that the "SysMenu" flag is only flag to remove Close button ( plus system menu and other titlebar buttons ) But , I can create a Form with disabled Close button , by this way : 1. Handling WM_StyleChanging message , don't allow changing "SysMenu" style 2. Set Form.ControlBox=False This is the picture[^] And , I don't know why , when I use Spy++ to view Form's window styles , before and after disabling Close button ( using above two steps ) , Form's window styles doesn't change My question is : How to disable Close button using Window Style flags ?

          1 Reply Last reply
          0
          • K Ky Nam

            I want to remove Close button only , not system menu & minimize/maximize buttons Thanks

            K Offline
            K Offline
            Ky Nam
            wrote on last edited by
            #5

            I will do it by disabling Close menu item in window's system menu

            1 Reply Last reply
            0
            • S Senthil S

              Hi, I thing this is not possible of removing close button. Because the form loaded by means of inherit from the form class. But we use control box said to be False n Remove all text in text in the Text Properties. Which will remove close button n Max n min buttons also. Then it is batter to create of ur own of Max n Min button...

              Senthil S Software Engineer

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

              Senthil S wrote:

              Senthil's Reply for

              Why do you prefix your replies thusly? I'm not making a critisism or anything, I'm just curious.


              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

              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