Questions tagged [windowstate]

70 questions
53
votes
4 answers

How can I make a WPF window maximized on the screen with the mouse cursor?

According to the MSDN documentation for the WindowStartupLocation Property: Setting CenterScreen causes a window to be positioned in the center of the screen that contains the mouse cursor. Although the MSDN doc for the CenterScreen Field itself…
Eben Geer
  • 3,696
  • 3
  • 31
  • 34
22
votes
8 answers

WPF : Maximize window with WindowState Problem (application will hide windows taskbar)

I have set my main window state to "Maximized" but the problem is my application will fill the whole screen even task bar. what am i doing wrong ? I'm using windows 2008 R2 with resolution : 1600 * 900 Here is the Xaml :
Pouyan
  • 2,849
  • 8
  • 33
  • 39
18
votes
4 answers

How do I trigger something whenever the WindowState changes in C#?

So I want to instantly, as this portion of the program relies on speed, trigger a function when the windowstate is changed in my main form. I need it to be something like this: private void goButton_Click(object sender, EventArgs e) { //Code } I…
Jon
  • 2,566
  • 6
  • 32
  • 52
10
votes
1 answer

Remember Window position, size and state [on Win + Arrow alignment] (with multiple monitors)

In our project we save the Window Size, Position and Minimized/Maximized Settings, so we can open the window at the exact same spot and size when we re-open it. All this is working quite well, using the Window-Behavior-class found at the bottom of…
Kevin Cruijssen
  • 9,153
  • 9
  • 61
  • 135
9
votes
4 answers

Binding the "WindowState" property of a window in WPF using MVVM

I bound the "WindowState" property of my main window to my ViewModel in order to change the state of the window by a command, but the first time I minimize the window it minimizes like a worksheet does in an Excel file. Is there a work around for…
Nick O
  • 3,716
  • 6
  • 38
  • 50
9
votes
3 answers

WPF: Window stays minimized even when setting WindowState explicitly

My application has a tray icon which, when double-clicked, hides or shows the application window. My issue is that I can't seem to bring the window to the foreground if it was in a minimized state when it was hidden. For instance, say the user…
dreijer
  • 654
  • 8
  • 22
8
votes
4 answers

Setting WindowState to Maximized causes window to appear too early

I read that the Load event is supposed to be fired after the window handle has been created, but before the window actually become visible. For the most part, this seems to be true. However, I've found that when I create a form with the WindowState…
user1283610
  • 116
  • 1
  • 1
  • 4
6
votes
3 answers

Checking the value of the window's "WindowState" in a Trigger

In WPF, is there a way to check the window's "WindowState" property in a Trigger? I've tried using the value of "0", "Minimized" and "WindowState.Minimized." EXAMPLE:
Nick O
  • 3,716
  • 6
  • 38
  • 50
5
votes
1 answer

Open a window from System Tray icon

So I created a window with a system tray icon. The window starts out minimized and will re-appear when the system tray Icon is clicked. However, it ONLY works when you click on the minimize button. If you click the red exit button the window…
DotNetRussell
  • 9,716
  • 10
  • 56
  • 111
4
votes
2 answers

How to pass WindowState from desktop shortcut into WPF app?

How can I control the initial WindowState (Normal, Minimized, Maximized) of a WPF main window from a desktop shortcut? The "Run:" combobox of the shortcut's properties dialog let's me choose between "Normal window", "Minimized" and "Maximized". But…
candritzky
  • 123
  • 1
  • 5
4
votes
3 answers

How to listen for "visible" property of Window in Swing/AWT?

There is a bean property "visible", which is represented by getter isVisible() and setter setVisible() in class Window. How to listen for this value? I would like to implement popular "view" menu with check box with binding library. Unfortunately I…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
4
votes
3 answers

How can I prevent other apps from stealing the focus?

I have a fullscreen window with the Topmost property set to true. Whenever an application changes its WindowState property, my window is automatically minimized even though it has the active focus. For example, the code below exemplifies the…
user246392
  • 2,661
  • 11
  • 54
  • 96
4
votes
1 answer

QWidget onMinimize() onMaximize() signals

I'm trying to find a signal to know when a qwidget is visible or not, I mean, when a QWidget is at the top of the desktop or when it's hide under some window. I also would like to know with a signal when a QWidget window is minimized and when it's…
Hermandroid
  • 2,120
  • 4
  • 29
  • 35
3
votes
2 answers

A form that was changed from .Hide() to .Show() can't maximize,why?

I written a method that Hide or Show all forms of application(including forms children). The code is the following: public enum FormState { Show , Hidden, Enable, Disable } private void SetAllFormsState(FormState formState) { …
The Mask
  • 17,007
  • 37
  • 111
  • 185
3
votes
1 answer

Window without WindowStyle and maximized window state hides the taskbar

WPF application with WindowState Maximized and WindowStyle None hides the taskbar. Since my application runs on a Customer Wrapper Application which has its own taskbar and Windows Start button equivalent, i need to ensure that my application doesnt…
ioWint
  • 1,609
  • 3
  • 16
  • 34
1
2 3 4 5