One of the most loved and hated feautures of visual studio must be the form designer.
Creating a simple form/user control layout usually is a breeze. Setting properties and adding events is easy.
Setting up the toolbox to use you own controls can be a bit harder and getting the ToolBoxIcons to show up can be a pain. Using third party components by visual inheritance can throw of the designer. And using multiple inheritance on designerables can be really hard.
So what are your favorite 'hidden' and or obvious visual studio designer features.
If you are viewing the code then Shift-F7 should show the designer. Alternatively in the Solution Explorer right click on the form and select View Designer. If that doesn't work make sure you have the class definition in your form code file, generally Form1. vb.
From the Solution Explorer window select your form, right-click, click on View Designer. Voila! The form should display. Save this answer.
So open the solution explorer (View -> Solution Explorer, or Ctrl + W , S ). Select one of the mentioned classes like form or user control. Right-click it and from the context menu select View Designer (or simply Shift + F7 ). That will move you to the designer view.
CTRL
and drag a control to duplicate it.NOTE: Be careful, if your control has an event handler that was created by the designer, it will associate your newly created control with the event handler as well as the old control.
Use the keyboard shortcut F7 to go from the designer view to the code view, and Shift-F7 to go from the code view to the designer view. I use this constantly
The "Document Outline" window is essential for heavy designer use. This allows you to reorder the controls in the outline to bring them to the front or send to back. It's especially useful when you're working with docking controls. You can also move a child control to a different parent, or take it out of a container control, or move a parent into a container, etc...
View -> Other Windows -> Document Outline
View -> Toolbars -> Layout
When the WinForms project designer is open on a form or user control and you have nested child controls, you can move the focus off of the currently focused child control to its parent control by pressing the Escape key. Pressing the Escape key again moves focus to its parent and so on until you finally reach the top.
Did you know you can actually debug the designer?
You can start up a single solution twice and use 'Attach to process' to debug a devenv environment running your designer controls. This can be especially helpfull to debug 'strange' designer problems that give very little information otherwise.
I used this to pinpoint a designer problem to some remoting that got started and didn't work triggering an unhandled exception and breaking the designer. All I saw at the desigerview was some visual studio internal helper classes crashing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With