I want to add a custom loading indicator when a button on child window is clicked. The loading overlay should appear above the whole screen. For this, I have created an overlay in rootvisual page which is hidden initially. When a button on child window is clicked, I make that overlay visible, but the problem is, the overlay appears behind the child window. What should I do to make it visible above child window? Is there any approach better than one I am using?
I could create overlay without having to use something like Modal Window or another Child Window. I created one div occupying whole screen and containing loading.gif. The div is hidden initially (display:none) While I want to show loading indicator, I make that div visible through Silverlight code as shown below:
HtmlElement div = HtmlPage.Document.GetElementById("loading-overlay");
div.RemoveStyleAttribute("display");
To hide the loading indicator again,
HtmlElement div = HtmlPage.Document.GetElementById("loading-overlay");
div.SetStyleAttribute("display", "none");
Related
As the title says, I have a pictureBox and a button (Windows Form Application) and I need that button to appear on top of the pictureBox as right now the pictureBox hides the button when I put them together.
Thank you in advance !
You need the BringToFront method:
button1.BringToFront();
You can access this method design-time through (Right click => Bring To Front)
When you do that, the designer is changed so that the button is added first to its parent, that way it is on top.
Docs:
The control is moved to the front of the z-order. If the control is a
child of another control, the child control is moved to the front of
the z-order. BringToFront does not make a control a top-level control,
and it does not raise the Paint event.
There is Bring to front operation in context menu in winforms' designer
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 have the following problem:
I have set a background image to the parent form. And every time I open a child and move it somewhere, the parent redraw the bgimage, or reload it and because this it looks like lagging. Can I somehow disable this effect?
I'm curious about Popup control in Windows Phone. For me, it's some kind of panel, that has IsOpen property. And I should used it, when i want to present some only in some defined context (e.g. button pressed).
But why not use just normal stack, or grid panel, and when use Visiblity when you want to hide, or show it? It's seems to behave the same.
You can change the Horizontal and Vertical position of the popup using the HorizontalOffset /VerticalOffset properties in the Popup control. We don't have that option in the Grid and to other panels.
It is an overlay. It doesn't break page layout as it shows above the main content.
While StackPanel or Grid should be added to main content and when they are shown they'll move other controls down.
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