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. Windows Forms
  4. Forms with only a Menu Bar

Forms with only a Menu Bar

Scheduled Pinned Locked Moved Windows Forms
csharpwinformsquestion
5 Posts 2 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.
  • T Offline
    T Offline
    TyrionTheImp
    wrote on last edited by
    #1

    Hi , I`ve got a basic doubt about WinForms ... Is it possible to create a form that has no client-area at all , but only a menubar that stretches across the entire width of the screen ? The method i tried was to set the client area property of the form to (ScreenWidth,0) but it doesn`t work (a little strip of the client-area in grey is still visible below the menubar). If its not possible to do so,is there some basic concept here which i`ve missed out on ? Thanks in Advance

    K 1 Reply Last reply
    0
    • T TyrionTheImp

      Hi , I`ve got a basic doubt about WinForms ... Is it possible to create a form that has no client-area at all , but only a menubar that stretches across the entire width of the screen ? The method i tried was to set the client area property of the form to (ScreenWidth,0) but it doesn`t work (a little strip of the client-area in grey is still visible below the menubar). If its not possible to do so,is there some basic concept here which i`ve missed out on ? Thanks in Advance

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      If you change the fromBorderStyle to None you will only have the menu bar left. Hope that helps. Ben

      T 1 Reply Last reply
      0
      • K kubben

        If you change the fromBorderStyle to None you will only have the menu bar left. Hope that helps. Ben

        T Offline
        T Offline
        TyrionTheImp
        wrote on last edited by
        #3

        Hi Ben , Many thanks for replying ! I created a simple Form with a Menu & set the FormBorderStyle to None so this removes the scroll bars, system control box,min/max/close button etc... But a grey area (which i think is the client area ) still persists just below the menubar. I`ve tried working with the form height, size,clientarea and autoscalebasesize too , none of which works :( An alternative way i found was to override CreateParams and fiddle around with the WS_BORDER,WS_CAPTION values but again , the grey bar issue remains. I`ll be grateful if any1 can tell me a way in which i can make a BMP of this available (since i dont think images can be embedded in posts ) coz it`ll give a clearer idea of what exactly is going on Hoping the CP wizards can help me out here ! thanks !

        K 1 Reply Last reply
        0
        • T TyrionTheImp

          Hi Ben , Many thanks for replying ! I created a simple Form with a Menu & set the FormBorderStyle to None so this removes the scroll bars, system control box,min/max/close button etc... But a grey area (which i think is the client area ) still persists just below the menubar. I`ve tried working with the form height, size,clientarea and autoscalebasesize too , none of which works :( An alternative way i found was to override CreateParams and fiddle around with the WS_BORDER,WS_CAPTION values but again , the grey bar issue remains. I`ll be grateful if any1 can tell me a way in which i can make a BMP of this available (since i dont think images can be embedded in posts ) coz it`ll give a clearer idea of what exactly is going on Hoping the CP wizards can help me out here ! thanks !

          K Offline
          K Offline
          kubben
          wrote on last edited by
          #4

          There is just one more thing to do. In the form properties set the BackColor to something like Red. Then in the form properties set the TransparentcyKey to something like Red as well. It doesn't matter what color you pick as long as these two properties are the same. That will cause the line to go away. Hope that helps. Ben

          T 1 Reply Last reply
          0
          • K kubben

            There is just one more thing to do. In the form properties set the BackColor to something like Red. Then in the form properties set the TransparentcyKey to something like Red as well. It doesn't matter what color you pick as long as these two properties are the same. That will cause the line to go away. Hope that helps. Ben

            T Offline
            T Offline
            TyrionTheImp
            wrote on last edited by
            #5

            Hi Ben, it works like a charm ! many thanks for ur help :)

            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