I am making a webbrowser and I have to make the tabs draggable. So when you pull out a tab, I delete the tabitem from the tabcontrol and put it in another window, which I create on that very moment, and that's the tab, the window, you drag. Now I have to be able to drop the tab back in so I need to check if the window, the window I am dragging, is over another window where it could be dropped.
So I actually need two things:
1) Is the window over another one?
2) If it is over a window, is it the first window underneath the window youre dragging?
Thanks in advance
This should give you a good starting point Drag and Drop Overview
Related
When I set the main window's visibility to hidden, No icon is shown in taskbar, so I have no control over the window to show it again. I want for the application's icon to be visible even when I hide the window, and to show the window when I click it's button in the taskbar. (something like minimize behavior)
How can I achieve that using WPF and .Net 4.0 in C#?
Edit: I mean the icon in taskbar (usually in the left and middle of the horizontal taskbar) not the notifyicon in system tray.
So, based on "comments" section, what you are looking to do is minimize or hide a window but still show some windows or dialogues that the window opens. First if you want to keep your window in the task bar, you should minimize with:
this.WindowState = WindowState.Minimized
That can be called from anywhere within the form. As you mentioned, though, this will close hide any dialogues that have this window set as the parent. The key, then is to not use this window as the parent. Lets say your dialogues inherit from form. You want to use:
newWindow.Show();
I am guessing that you are calling "ShowDialog", which ties the window state to the parent window state. Try this out and hopefully it will help!
Edit
One more note: the same is actually true of MessageBoxes, but the way to control the parent form is with the first parameter of the MessageBox.Show() call. If you pass in a form as the first parameter, that will be the parent, otherwise the parent will not be set.
I am new to WPF and was trying to make a Sidebar like menu in my Application. I want to load appropriate windows in the right side (75% of the total width) based on the items selected in the sidebar (located in the left, 25% of the total width). Is that possible?
I dont think you can have Window inside another Window that is one of the difference between UserControl and Window that you cant have Window as child of another Window but you can have one or more UserControls as child.But you can do that using Two Windows one for your Menu and another Window that is going to be according to your selected Item in Menu. But you must set the SideBar Windows TopMost property True.I hope this will give you an idea
I have created a window in C# by win api. And made it as child to another window. This parent window is an external program and I don't know its source code.
When i move my window inside parent window some parent's elements draw itself on my window.
For, better understanding i've made some screens.
This is before I move my window. My window is gray.
And this one is after moving my window over the "SeatOpen" button.
I have no idea how parent window can draw on my window.
So, why this is happening and how to fix?
The parent window is not drawing on your window... you are failing to draw on your window yourself -- your window is not responding to WM_PAINT messages for some reason so whatever garbage was on the screen remains there.
Try to redraw your window when location is changed and it is over Seat Open button.
I have a parent form and some child forms. Each of the child form has an icon at the top and left of the form. I would like to discard those icons but when I click on the icon property, I can only browse another icon and not delete the existing one. For that reason I set the showIcon property in each child form to false and the icons are not visible any more on the forms. So far so good.
My problem is that when a child form is open and maximized, the icon is shown. I want to make it go away and unfortunately I didn't find a way to do this. Any suggestions?
Thanks!
EDIT: I added a screenshot of the form, the unwanted icon is shown above menu strip. I want it to go away. When child form is NOT maximized, the icon disappears.
I guess you need to create a custom form border.
Please check http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx
I need help on WPF...
When user move/drag/change the position of the 1st page window (mainwindow.xaml), then user click on "next" button to proceed to 2nd page(process.xaml), the window (process.xaml) is not at the same position as the (mainwindow.xaml) that the user move to earlier on. How can I make it to remember the position of the window throughout? And when user close the window, and run it again, the window will be default appear in the center unless user move the window.
Really need help for this. Thanks.
Maybe it would be easiest to only have one window throughout the whole application, but replace the window's contents? Create your screens as usercontrols instead, then set content on the main window instead of opening a new one..
You might want to make use of the WindowStartupLocation for process.xaml.
Setting WindowStartupLocation to Manual causes a window to be positioned according to its Left and Top property values. If either the Left or Top properties aren't specified, their values are determined by Windows.
Like this:
this.Owner = MainWindow; // reference to mainwindow.xaml
this.Left = Owner.Left;
this.Top = Owner.Top;
this.WindowStartupLocation = WindowStartupLocation.Manual;