How to create a control like Solution Explorer in Visual Studio? - winforms

I want to create control that seems and works like the Solution Explorer of Visual Studio.
I mean not the functionality of solution explorer, the control should be seems like that control. That means, server explorer, toolbox, error List,... All these controls will pop-out when we put mouse and pop-in when we leave. We can lock and unlock those controls also.
So can anyone help me, to get the solution for this problem.
Thanks!!!!!!!!!!!

I am assuming you are using C#/VB.NET for development. The dockpanel suite will provide a docking framework for an application. Basically in terms of dockpanel, it is the forms which can be docked on the application using drag and drop like visual studio.
So create a treeview control in the form and dock it to the parent. You can populate the treeview control based on file directories or any specific needs of your project. Please note in dockpanel you create a form by not inheriting from Form class but from DockContent class. Documentation will give you more insight of how to create applications. It has a good example along with the source code in which it simulates the all the visual studio panes. It also provides and option to save the position of various docks which can act as a user preference. For eg, you may like to position solution explorer on left side whereas i may want it on right side. this get stored in a conf file which gets read next time when you start the application.
Incase you using MFC, then visual studio 2008 SP1 provides you with docking framwork and within that use the treeview control.
XAML also provides a docking framework. But i am not sure, you need to verify.
Win32 API does not have any native docking framework.

Related

WPF: How to know Open Window, User control name

In the web application, we just right click on the page go to properties and can see the opened page path. How to achieve this in WPF application. I am running a WPF app having windows with many user control. I want to edit a user control. So I want to know its name and location in my project folder.
That is not possible like how you can in a web application, however there are some tools that can help you.
WPF Snoop
Used to inspect WPF application rather like 'Inspect Element' in a webpage. After inspection, pressing ALT+SHIFT will higlight what element is under the mouse and show you its name. Then you can search for that name in Visual Studio to find the class to edit.
See https://github.com/snoopwpf/snoopwpf
Visual Studio XAML Inspector
The microsoft version of the above 'Live Visual Tree Inspector' now built into Visual Studio and compatible with .NET Core 3.0 as well as .NET Framework.
See https://learn.microsoft.com/en-gb/visualstudio/xaml-tools/inspect-xaml-properties-while-debugging?view=vs-2019

Can i implement extreme design elements in my app with Visual Studio, or do i need Blend?

I'm new to Visual Studio and Blend and i'm trying to see their difference. I thought that Blend was ideal for adding more design and interactivity into your app so i chose to use this in order to create an app about a virtual museum (which i wanted to include design and 3d elements).
So far i have created 2 Grids. The 1st Grid contains a sign in or sign up option(along with its design for which i used Blend tools). The 2nd Grid is the registation form which i wanted the user to be redirected to after the user has clicked the sign up button. I'm trying to make the transition from grid 1 to grid 2 like if i had two windows forms, but i can't seem to find how i can do that. Any ideas on how to do it?
I tried to open it into Visual studio and it doesn't seem to respond that well.I suppose i must do something wrong.
So taken the previous difficulties, i'm wondering whether Blend is not necessary to use to create this kind of app and i could simply use standard Visual Studio's windows form without having problem adding design elements.
Thanks in advance
Visual Studio has all that you need to be able to do your interfaces as you want them to be. As Glen Thomas said, you should learn how to code in xaml to create your interface. Visual studio gives you a render of what it looks like in real-time while coding it so it might be helpful to do it this way.

WinForms.net: a control for one project only

I want to make a composite control which I could drag to form multiple times, but this control should reside in one project only. I do not like the idea of making a control, and installing it to be visible to all projects in a Visual Studio 2010 Toolbox.
So, I assumed that the UserControl is what I needed. I created one, but now can't drag it to a form or find it in the Toolbox.
Tools > Options > Windows Forms Designer > AutoToolboxPopulate is set to True.
I had to compile the project to make UserControl appear in the Toolbox.

How can I make a WPF custom control automatically appear in the Visual studio toolbox?

If I create a WPF user control, it appears automatically in the Visual Studio toolbox.
Is there a way to make other controls appear automatically in the Visual Studio toolbox?
Conversely, is there a way to hide a user control from the toolbox?
You can right click on the toolbox and select Choose Items... Then from there you will get a dialog that allows you to select which controls to show or hide.
Per comment below if you are trying to figure out how to do this for a Third Party that you are providing your control to check out this MSDN article that describes packaging your control:
http://msdn.microsoft.com/en-us/library/ms165358.aspx
Auto population is described here (at the end), but to summarize you can add DesignTimeVisible(false) to your UserControl to prevent it from being added to the Toolbox.
Your controls should be added just like your UserControls, assuming they meet the requirements at the end of the link above, which are:
To appear in the Auto-Population
Toolbox process a type must derive
from FrameworkElement and:
Are public and have a default public or internal constructor or are
internal and have either a default
public or internal constructor
Types deriving from Window or Page are ignored
FrameworkElements in other .exe projects are ignore
Internal classes will only be displayed when the active designer is
for an item in the same project
Friend Assemblies are not taken into account for Toolbox
Auto-Population
If you are building reusable controls (where your end-users will simply add a reference to your assembly), then you'd need to tell Visual Studio that it should load your controls into the Toolbox. There is a tutorial for WinForms controls on doing this here, but the concepts are the same. A VSIX installer tutorial can be found here.
A lot of the resources out there are for older versions of Visual Studio, but again the same concepts should apply. You simply need to update version information where appropriate.

Building Visual studio like application, need inputs

I am working on a Visual studio like application i.e. have a toolbox, an editor and property grid similar to VS.
User can drag and drop the controls(custom and third party) to the editor window and perform operations like resize, move, align, group etc.; Properties of that control needs to be displayed in property grid and user can update them from there.
As per my current understanding I will have to extend the Canvas to create my own editor and and Interface for controls which it supports; Each supported control will have to implement this interface so that it can be placed in our editor.
Something similar to this - http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part4.aspx
Looking forward for any kind of help, comment or links.
If WPF is a requirement, wait for the VS2010 release and use the Visual Studio Shell in either isolated mode or integrated mode. Otherwise you can use the Visual Studio 2008 Shell isolated or integrated.
You'll get the docking support, addin model, editors with highlight and much more almost for free that way.
Finally, I used the Diagram designer approch to build my application. Although, I had to create my custom property grid which was painful.
Recently I came across following post which suggests that .Net DesignSurface can be used for building this kind of application -
How to create an UI Designer utility?
I have been working on a generic framework Wide to create VS like applications.
Update: Here is the CodeProject article on how to use the framework.
Wide comes with two modules and various out of the box functions:
Core module (Required)
Used for customizable splash screen
Used for Menus (supports regular menus with icon, checkable menus)
Used for Toolbar (menu view model can be reused for toolbars)
Multiple toolbars can be added to the IDE (check demo)
Themes (VS2010, VS2012 Light theme and no theme)
ThemeManager to add/remove themes
Used for Statusbar (in development)
Open file service with participatory handlers (could be based on extension or even file contents)
Save and restore layout along with opening documents
Logger module (For the logging tool)

Resources