Forms with only a Menu Bar
-
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
-
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
-
If you change the fromBorderStyle to None you will only have the menu bar left. Hope that helps. Ben
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 !
-
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 !
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
-
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
Hi Ben, it works like a charm ! many thanks for ur help :)