Select the Panel and choose "Format | Order | Bring to Front" from Visual Studio's menu.Similarly, you could right-click on MenuStrip and choose "Send to Back". This will change Panel's position in form's Controls collection to 0, making it the top of z-order. Right-click on the Panel and select "Bring to Front".To fix this at design time, we have a few options: If Panel was put in front of MenuStrip, MenuStrip would still be visible (it's docked to Top) and Panel would only occupy the remaining of form's space. Now, as you've already guessed, we need to change control's z-order to make things look right. Thus, in the previous example, the form's Controls collection order is:, and since higher-layered controls can overlap those behind them, the Panel, having Dock set to Fill, can take all the space it needs, without MenuStrip blocking its way. The control's z-order is determined by its position in container's Controls collection, with the first control in the collection being at the front (top layer) and the last at the back. Why's that? The way how controls on a form are docked is determined by the z-order. This results in Panel's top area being hidden behind the MenuStrip: For example, put a Panel and a MenuStrip on a blank form (in that exact order) and set Panel's Dock property to Fill. A typical problem is the overlapping of docked controls. Talking to other developers and hanging around newsgroups and forums I noticed quite a few people have problems arranging controls on a windows form in design time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |