Paint.NET style ToolWindow - c#

Can anyone tell me how to make Paint.NET style ToolWindow(s)? Sorry I don't know if there is some kind of terminology to describe this better.
Currently my ToolWindows take focus whenever I click on a control inside of the ToolWindow or the ToolWindow itself. This means that if I click on the ToolBar or the MenuBar in the main form of my program that only bring the form into focus and doesn't actually click on the ToolBar / Menu. I don't want that.

You can donwload source code od Paint.NET and look how implemented "ToolWindows".
download page

Related

VS Designer Now Showing MainMenu

I can't seem to fix this issue (which i hope is small) i have somehow when adding a ContextMenu did something to have the MainMenu bar not show up when i debug, if i click on the "MainMenu" in the designer (1st image) the menu bar shows up in the designer fine:
But if i click off it, then click on another control like:
The MainMenu disappears from the designer, when i build / debug the MainMenu is gone, is there a way to fix this easily enough (i assumed it would be as simple as checking a setting but googling did not return anything that i saw that was helpful)
Any help would be appreciated.
It looks like your MainMenu has ended up hidden behind your other controls. Try right clicking on the main menu and selecting Bring To Front. If you can't right click on it, right click on the control that's filling the rest of the form and select Send to back.
When you click on a menu control in the component tray it will always show it at the top of the screen (even if you click on a ContextMenu).
One other thing worth doing is to open the Document Outline window from the View->Other Windows menu in Visual Studio. This gives you a hierarchichal view of all the controls on the current form. You should be able to see your main menu here (unless you've somehow removed it from your form!)

drop window in application into the main window like tab

i am working on application with multiple windows, but i want to drop any window in the application into the main window like tab and can drop it back like window.
i have tried to used drop event in C# and MouseDown event in xaml but didn't work
so any idea how to do that?
You can't have a child "Window" within a window.
You can have a child user control.
If you still want to have a child window, it would have to appear as a popup
Or you can do a custom implementation like
http://clipflair.codeplex.com/
http://www.c-sharpcorner.com/uploadfile/mahesh/wpf-child-window/
Updated Answer
For docking window you can use third party tools like
Devexpress
Avalon
Telerik
Or for a custom implementation you can try these examples
http://www.codeproject.com/Articles/140209/Building-a-Docking-Window-Management-Solution-in-W
http://www.codeproject.com/Articles/439873/Simple-Visual-Studio-like-Pane-Resizing-Docking-an
http://www.codeproject.com/Articles/22927/Multiple-Window-Interface-for-WPF
http://www.codeproject.com/Articles/18812/WPF-Docking-Library

wpf application which shows all forms in one window

hi I want to make a wpf c# application which shows every form(Ex:- user registration, reports , etc..)in one window in other words I want to make an application which have one window and every user control appears and closed there when I want just like games in some games like middle of honor warfighter they have one window and if we chose option option buttons appear in the same window and if we chose graphics that graphic page content appear in that same window.
and I want to know is there any frame work or special method is there which I should fallow other than putting wpf controls one over another and changing there visibility and isopen status.If there is any examples please give me a link
You can use ContentControl for holding any element. also PRISM is best approach.
You can use WPF Popup forms below are some links for more info:-
http://www.dzone.com/articles/understanding-wpf-popups
http://www.c-sharpcorner.com/Blogs/11700/
Take a look at this MDI Control. It helps you to show any kind of usercontrol in one container as window.

Using one Windows Form - Visual Studios c#

I am making a Multiple Choice test application using Windows Forms on Visual Studios. When a user answer one question, they will click next to proceed to the next question. Would I be able to use a single windows frame to display all my questions? When I do it on more then one windows form I had to do this.Hide() and then .Show() the other form. I don't have a problem with doing this but when it hide and shows the other windows form it isn't open on exact same position, it keeps moving.
You can create a UserControl that displays the question and the multiple choice answers. When the user clicks the Next button, you remove the UserControl from your form's Controls collection, create a new instance of your custom UserControl with the next question's details on it, and then add the new instance to your form's Controls collections. This structure will let you do the app on a single Form.
I would better suggest you to use Panel form the tool box for multiple forms. It would be better for the multiple choice questions.
Then for every panel use property visible set to either True or false depending on which panel you want to navigate.
See this to understand more in detail
http://www.youtube.com/watch?v=CDOXzz_0gYE&feature=related
You can use wizard.
Here you have two links:
http://www.codeproject.com/Articles/18674/A-Simple-Wizard-Control-for-Net-2-0-with-Full-Desi
Add this library to Toolbox:
Right click on the Toolbox and select "Add Tab" from the context menu.
Specify name for the newly created tab, such as "Wizard".
Activate the tab, right click on it and select "Choose Items..." for the context menu.
Now browse to the folder where is assembly "WizardBase.dll" and select it.
http://winformswizard.codeplex.com/
The simpler the better.
The simplest way is to make a panel, (in one window), and then add labels with your question and all options of the answer in that panel. Then on the click on the NEXT button, change the texts of all the labels at once.
As far as your problem of opening different windows on the same position on the screen, change the DefaultPosition property of all the forms to CenterScreen or CenterParent.

Left Menu Tabs Control in Windows Forms Application How can i get it? Its available in current controls?

i am building a C# application, i have explored its all controls but i cant find the left menu style which i usually see in software applications for example visual studio, i am attaching the image of what i need.
Please let me know how can i use it in my forms. I have used a tab menu control in visual studio, but it is not what i required, its tabs are vertical, but i want the exact like i shown in attachment. I think it requires some reference to add.
I don't think that control is available, which means you would have to make one yourself. Here is a link from someone that made one. I haven't tried it: Visual Studios "My Project" Tab Control
There is no such a control in the ToolBox by default. But you could create one for you.
Creat a user controller.
Added a SplitContainer and set Dock.Fill.
Add a FlowLayoutPanel to the Left panel. Add buttons or labels as you wish and implement the click event.

Categories