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. Windows Forms
  4. How to chane title bar of a window form in C#

How to chane title bar of a window form in C#

Scheduled Pinned Locked Moved Windows Forms
tutorialcsharpdesignhelp
7 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.
  • W Offline
    W Offline
    WinSolution
    wrote on last edited by
    #1

    Hi Everybody If anyone can one help me to change the traditional title bar for a window form in C# so i can use an image insted of that and can atach button such as Minimize, Maximize and Close of my own design please help me by example or give me any reffrence urls for help thanks Altaf

    K 1 Reply Last reply
    0
    • W WinSolution

      Hi Everybody If anyone can one help me to change the traditional title bar for a window form in C# so i can use an image insted of that and can atach button such as Minimize, Maximize and Close of my own design please help me by example or give me any reffrence urls for help thanks Altaf

      K Offline
      K Offline
      Kristian Sixhoj
      wrote on last edited by
      #2

      You need to set the FormborderStyle to None and then create your own title bar from scratch. It's actually easy.. Just drop some labels, buttons, whatsoever at the top of your form. Or perhaps create a panel just for the title bar.

      Kristian Sixhoej


      "Failure is not an option" - Gene Kranz

      W 1 Reply Last reply
      0
      • K Kristian Sixhoj

        You need to set the FormborderStyle to None and then create your own title bar from scratch. It's actually easy.. Just drop some labels, buttons, whatsoever at the top of your form. Or perhaps create a panel just for the title bar.

        Kristian Sixhoej


        "Failure is not an option" - Gene Kranz

        W Offline
        W Offline
        WinSolution
        wrote on last edited by
        #3

        Hi Kristian Sixhoej Thanks for quick response That thing was also in my mind but i was thininking that is there any method to overide it. the prolem is this when i hv about 25 forms then it will be a tedious task what u think? i want some wrriten method just written one time any copy paste to toher forms. Possibely by overriding paint method or ........ but i hv no idea yet about overriding paint method (i mean what can i do with it. Is the thing i m saying is possible with this or not) waiting for ur reply.

        K 1 Reply Last reply
        0
        • W WinSolution

          Hi Kristian Sixhoej Thanks for quick response That thing was also in my mind but i was thininking that is there any method to overide it. the prolem is this when i hv about 25 forms then it will be a tedious task what u think? i want some wrriten method just written one time any copy paste to toher forms. Possibely by overriding paint method or ........ but i hv no idea yet about overriding paint method (i mean what can i do with it. Is the thing i m saying is possible with this or not) waiting for ur reply.

          K Offline
          K Offline
          Kristian Sixhoj
          wrote on last edited by
          #4

          As far as I know, it isn't possible to change the title bar programmatically (except from changing the text, but that could just be done via the Text property). The easiest and most comfortable way would propably be to do it in this way. But then you also have 100% control over what the title bar will get to look like. EDIT: By the way, if you're experienced in doing user controls, you could make the title bar as a user control and just drag and drop it onto each form. -- modified at 15:36 Friday 23rd November, 2007

          Kristian Sixhoej


          "Failure is not an option" - Gene Kranz

          W 1 Reply Last reply
          0
          • K Kristian Sixhoj

            As far as I know, it isn't possible to change the title bar programmatically (except from changing the text, but that could just be done via the Text property). The easiest and most comfortable way would propably be to do it in this way. But then you also have 100% control over what the title bar will get to look like. EDIT: By the way, if you're experienced in doing user controls, you could make the title bar as a user control and just drag and drop it onto each form. -- modified at 15:36 Friday 23rd November, 2007

            Kristian Sixhoej


            "Failure is not an option" - Gene Kranz

            W Offline
            W Offline
            WinSolution
            wrote on last edited by
            #5

            Hi Kristian Sixhoej Is there any method when i click on a button labeled as "Minimize" the form get Minimized (and for maximize also) i have not found that in inteliSense Popup with this handle

            K X 2 Replies Last reply
            0
            • W WinSolution

              Hi Kristian Sixhoej Is there any method when i click on a button labeled as "Minimize" the form get Minimized (and for maximize also) i have not found that in inteliSense Popup with this handle

              K Offline
              K Offline
              Kristian Sixhoj
              wrote on last edited by
              #6

              You need to use some API functions to do that. Read about ShowWindow() in this article: http://www.codeproject.com/csharp/windowhider.asp[^]

              Kristian Sixhoej


              "Failure is not an option" - Gene Kranz

              1 Reply Last reply
              0
              • W WinSolution

                Hi Kristian Sixhoej Is there any method when i click on a button labeled as "Minimize" the form get Minimized (and for maximize also) i have not found that in inteliSense Popup with this handle

                X Offline
                X Offline
                Xmen Real
                wrote on last edited by
                #7

                For Maximize and Minimize, use

                this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
                this.WindowState = System.Windows.Forms.FormWindowState.Minimized;

                Becoming Programmer...

                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