How can I open a child window and keep the parent window active. I am using Silverlight 5 with the latest version of the toolkit.
I understand that playing with the brushes can help to have the background look normal but the parent window is still disabled.
I am trying to implement a find feature similar to a control F. I want the user to search in a child window and the matches would be displayed on the main display.
Thank you for your help,
ChildWindow is made for modal (disables the parent) use.
It uses a overlay window to make the background appear disabled as you've discovered, however it also marks the Application.Current.RootVisual's IsEnabled to false, which it then restores when the ChildWindow is closed.
This prevents any interaction to the controls of the 'parent' window. The only way around this to make your own style ChildWindow control but leave out this behavior.
FloatableWindow is a codeplex project from Tim Heuer's work, which is a nice quick way to solve your problem. Altho it appears as tho the project hasn't been updated in a while so compatibilty with the latest silverlight version might be in questionable.
DevExpress has a DXDialog control which includes Show and ShowDialog functions for modal and non-modal behavior. I'm sure other silverlight toolkit companies provide similar alternatives, this is just one I'm familar with.
If you don't mind making a custom control you could follow something like Tim Heuer's blog post on the subject to adapt your own control or use a tool like Reflector to reverse engineer the ChildWindow from silverlight itself and remove the parts you don't want.
Related
For a while now I have attempted to get into UI design with WPF. My main goal is to create a good-looking application in a borderless window, like for example:
I made this example using the MetroUI framework. While this framework does the trick on borderless window functionality, it also does way too much for my tastes, custom controls, skins, animations, etc. I just want a borderless window and decide everything else myself.
I've searched stackoverflow a lot, and tried a fair amount of frameworks, but nothing seems to suit my needs.
Basically, I would like to have a borderless window with FULL windows functionality (drag to sides to pin, only show shadow if operating system settings has it on, etc etc).
Putting WindowStyle to None but keeping AllowsTransparency at False in order to preserve the original window chrome makes most if not all of the functionality I am seeking for work. However, the obvious problem here is: the window chrome is still there.
This looks like this:
To finally ask my question:
Can we keep all the current functionality that this window chrome provides, but somehow make it invisible (yet keep the dropshadow it provides) ? I can live without the dropshadow but it would be a nice bonus.
Or to ask a more broad question: is there any framework / pre-made project, that simply ONLY handles making a borderless window work properly and no other additional controls, skinning, ... ?
The more time I put into this the more it seems making borderless windows with WPF is simply incredibly clunky and I am getting rather unmotivated on my entire project because of this.
Thank you
See my answer on the following thread, it pretty much sums up all the window issues at once. Hope it helps!
WPF Borderless Window issues: Aero Snap & Maximizing
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.
My C# standard windows forms app is finished, it has 10 forms. But the new requirement is now to change the "multiple forms" to one dashboard where you click a link on a bar on the side or top and switch between forms in the main area of the dashboard one at a time, pretty much exactly the same way an old HTML frame works with framesets (just imagine my Windows Forms are framesets).
Without going into much detail, each of these forms are pretty involved, multiple threads and so on, and I am looking for a simple trick to display them, as oposed to recoding the entire thing.
I looked at http://www.codeproject.com/Articles/37397/A-Multipanel-Control-in-C
but it's not what I want.
Is there a way to do this?
If you convert the forms into custom controls, it then becomes pretty simple to use the TabControl http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.aspx to display the custom controls on the surfaces of the Tabs it contains.
By making them custom controls you avoid the mixing of the code for each of them (they remain distinct) but they also become easily added to other surfaces. I do this with a UI with a dozen display tabs.
I would recommend that you either use a tabbed control, or use an MDI Container, or a combination of both. The MDI has some nice behaviors that you'll get for free by implementing it. You could hard code each tab to each form, or have a dropdown that selects each view. If you want to manage the lifecycle of each form, you could implement a singleton pattern on each, or use IOC.
Not entirely sure this is going to solve your problem, but if you have questions or more details, let me know.
I resolved this using MDI as suggested above, works great in .NET Windows Forms 4.0 and 4.5.1.
In the parent form:
Declare a new child form.
myNewChildForm.MdiParent = this;
set child form StartPosition to Manual.
set child form Location to 0,0.
set child form WindowState to Maximized.
set child form Dock to Dockstyle.Fill
That does the trick.
Thank you all.
With the Weifen Luo DockPanel component, one can add to their .net project the ability to dock forms within other forms. The component is very well done.
Now, I see from this page at the project forum at github (where this component is now hosted), that it is possible, through the use of this dock.extender to allow the floating windows to have a normal winform look, that is, sizeable with regular Windows title bar, maximize box, minimize box, etc (see here, too). This also allows for the form's icon to show.
My problem is, and hence my question, is that the icon I assign in the form's properties will show in the designer, but one it runs in debug as a float-panel, a generic form icons appears in its place.
Now, I tried assigning the icon through code (both in the form's own code, and in the main application code too, where the form is called) rather than through properties, and that didn't work either.
So how do I get my own custom icon to show as the form's icon when the form is floated, and the extender is used? I am using the main docking panel in DockingWindow mode.
[EDIT]
I think this is a hard question! It's been 2 days and I've not gotten any answers!
This requires a change to the the FloatWindow class itself to set and update the Icon property internally as the content changes.
I have just checked the change in and it will be included in the 2.7 release of the library.
https://github.com/dockpanelsuite/dockpanelsuite/issues/35
I have one big existing application using .Net - MDI C#,
Now I am going to change some looks for application, so it looks better for client.
But I a, facing a lot of issues when I try to add more than 2 images on the Parent MDI Form.
How to create Header, Content, Side Bar and Footer Section in MDI (For. Ref. find attach screenshot for application layout.)? Also can anyone tell me which tips like which control I used for this type layout?
You have been a member for 6 months, asked questions, but never answered a question,never commented on a question, and never even accepted an answer.
But if everyone in this community acted the same way, if everyone else was just a user, where would you be then? There would be no community, no resource, you would never get an answer or have any information to search. Think about it. Then think about actually joining the community and stop using it.
Now to answer your question, the Winforms MDI container does not natively support the functionality you are describing, however it does support siting UserControls directly on the MDI container. This makes emulating the functionality you describe very easy. Just create a UserControl that provides the graphical surface and controls you need and then use the docking properties to force the MDI container to place child forms correctly in the open client area instead of on top of a UserControl.
For example, to create a logo and then a menu bar underneath create a UserControl with the logo and menu bar. Create events and wire them up as needed to allow the MDI form to subscribe to events that pass any menu clicks back that the MDI form needs to handle. Finally site the UserControl directly on the MDI form and set it's docking property to top. Then any child forms will display correctly in the remaining client area underneath the menu bar on the UserControl.