Controls containing map [duplicate] - c#

One of our clients has an old WinForms application that contains forms with a lot of controls on them. Some of those controls have a deep hierarchy and that makes it to hard to select them in the designer.
I need to understand this hierarchy to make modifications to the application to correct some bugs. Is there a way to see this hierarchy clearly? For example, is there something available that is similar to what can be seen in an .aspx source file when you have a breadcrumb of where you are in the HTML hierarchy (HTML > Body > div > etc.)? Or something more visual maybe?

You need to use the Document Outline
View > Other Windows > Document Outline
Or via hotkey
Ctl + ALT + T

Click on View > Other Windows > Document Outline in Visual Studio.
That should show the control hierarchy.

Visual Style Builder for UI Customization - Download this tool and use it...
Another tool is present which is "Control Spy Tool for Easier Development"
You will find the solution easily..

Related

How can I have a solution based layout for my WinForms application?

I am coding a C# forms application where I am wanting to have the layout of my application to have a similar style of the Visual Studio 2013 layout. By this, I mean to have a property grid at the lower right of the screen, a solution explorer to the top right of the screen, tabs for the content and a toolbox.
Do I need to use a FlowLayout control for this? I have previously found some sample code with this layout all coded to use as a template, however I cannot seem to find this after doing a search. What is the correct terminology for this layout style? Also, is there a Microsoft sample for this?
Here is an image of what I am looking for:
Thanks.
You can use the following readily made controls from Visual Studio:
System.Windows.Forms.PropertyGrid for the properties
System.Windows.Forms.TreeView for the solution explorer
For the toolbox you will need to create a custom-control, with search box and dropdown tabbing of pages. See making of custom controls here:
https://msdn.microsoft.com/en-us/library/vstudio/6hws6h2t(v=vs.100).aspx
http://www.codeproject.com/Articles/2016/Writing-your-Custom-Control-step-by-step

Pre-defined XAML code for new control that is added in VS designer

Is there a way to automatically generate XAML code when you drop your control from toolbox to designer? I.e. it would create certain objects (nested properties) automatically and user would not have to type the same code every time to set certain (nested) properties. Kind of a template XAML code that is pre-defined by control's developer.
I'm pretty new to WPF so I'm wondering why there aren't any nested properties in the controls that are in Visual Studio's toolbox (button, label etc...)? Are attached properties a cure for this or have they just cut corners when designing WPF. :)
The problem is that my control (WinForms style property hierarchy) has nested properties and if I "internally" in my code create objects for those properties then XAML does not reflect the situation because it does not have any elements that match the current situation (i.e. the objects created in my control's constructor).
Is the only solution to leave all the properties null and let the user create them all? That way it seems to work correctly but user has to write many lines of XAML to reflect the situation in WinForms.
The functionality that you seek is not available via any of the controls in WPF. However, Visual Studio used to have Macros that would enable us to add pre-written sections of code into our pages, but unfortunately, they decided to remove that great functionality. Fortunately, they have introduced Code Snippets as a partial alternative.
Unfortunately again, these Code Snippets don't work in XAML pages, but once again fortunately, there are a few Visual Studio add ins that will enable you to enter pre-written XAML into your pages at the click of a button on the Code Plex website:
XAML Code Snippets addin for Visual Studio 2010
XAML Snippets for Visual Studio
Please try using one of the above add ins to see if they meet your needs.

Navigating between parental panels

I have problems with editing panels in C# windows forms(Visual studio 2008). I placed some panels into another, and now I have problems with navigating panels inside parental containers. Is there any tool that gives not only drag-drop control, but also tree view of container and panels in it. For example, like Navigator window in NetBeans(IDE for Java). Any help?
I'm not sure about VS2008, but newer versions have Document Outline Window (View > Other Windows > Document Outline)
To not get lost in controls, consider to name them properly. Then you can find them in the list of Properties window.
Instead of label1 use labelInputName, located on panel1, which you also rename to panelInput. This gives parent/child feeling and you will never lost.
If you get lost, use Document Outline window to see tree-like relation via Controls property (who is control of who). This window is a helper (help to find and select control), you will still have to use designer to do changes.
Another important thing is UI design. Whenever you get cluttered or bulky feeling, than it's the time to change something.
Making UserControl for repeatable part is one way.
Another is to differ design and run time (what you see in designer): to example, if you have several panels, which has to be shown at same place, then you can use dynamic container for them (FlowLayoutPanel, TableLayoutPanel) or you can have them placed in a way for you to easily see them in design-time, but their position will be corrected during run-time (to example, in the constructor). Prioritizing designing is a must if you are going to support project and edit functionality in next versions.
p.s.: talking about winforms, but all said should be true for wpf as well.

Creating a desktop application to design Master Page?

How would I go about creating a desktop application that would be capable of generating an ASP.NET master page, perhaps using drag and drop for the different allowed elements (image, text, video). I would take the co-ordinates and generate a master page that can be used later.
Any ideas would be great, I know the question is a bit strange and vague.
Well this is very strange of you to do this as there are already many tools to go about doing this.
Visual Studio (is itself Self Sufficient)
Expression Blend (if you need more control over Design)
Try them.
Still if you are keen about developing something that suits you custom needs then sure go ahead.
As the master page is similar to HTML DOM you can create tags and attributes according to the user's choice.
I suggest you take idea from Visual Studio Designer itself and develop something similar with room for your custom implementations. That way you customer's wouldn't have difficulty in switching to your Application.
As for HTML editing there are Various classes like HTML Element which you can use to create the DOM. Also try out some tools like HTML Agility Pack. Also search for some plug-ins that you can use for making things like HTML Editor. Some has been suggested in Jacob's answer.
It's unclear what you're looking for in an answer. There are several pieces to such a project. Here's what you'd have to create:
A text editor
An ASP.NET parser so that you can do syntax highlighting or WYSIWYG display
An assembly loader so you can detect which items to put in your toolbox
A drag & drop interface
An ASP.NET compiler so that you can test your work in a browser
You may want to look at existing frameworks as a starting point. Eclipse is an engine for building products like yours, so you could base your project in that framework. Scintilla is a popular library for writing text editors with syntax highlighting.

Which Tab Control does Visual Studio 2008 use?

Which tab control does VS 2008 use and is it possible to reference and use it in C# projects? I have not been able to find anything on the web about it, but admittedly "VS2008 Tab Control" is a bit generic.
It's a great tab control and I would love to leverage it in my own projects.
There is a wonderful one on SourceForge: WeifenLuo.WinFormsUI.Docking (or DockingSuite). Sorry no link (yet).
Update
Sourceforge link: Dock Panel Suite
Sample Project on CodeProject: A Visual Studio 2005-like Interface
The VS2008's tabbed MDI control is not available but there are some third party components that are quite good at it. Developer Express has one.
Further reading about tabbed MDI can be found on wikipedia
The document editing area in Visual Studio 2008 is more than just a tab control. It allows you to place documents in a vertical or horizontal stack. There is nothing similar provided as part of the standard window forms controls. You need to either create your own control or buy a third party control that performs the same action.

Categories

Resources