Problem restoring window - WPF

  • Thread starter Thread starter Mark Stevens
  • Start date Start date
M

Mark Stevens

I'm using C# to write a WPF Windows application. I have successfully
minimised the application to the system tray and removed it from the
taskbar using the Hide method and setting ShowInTaskbar to false.

When I try the reverse, setting ShowInTaskbar to true and executing
the Show method, the window appears in the taskbar but not on the
display. If I click on the window in the taskbar then it appears.

Any pointers would be appreciated.

Cheers,
Mark
--
|\ _,,,---,,_ A picture used to be worth a
ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
|,4- ) )-,_. ,\ ( `'-' came television!
'---''(_/--' `-'\_)

Mark Stevens (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
 
Try putting the Show method into a Dispatch call with a low priority
so that all the window registration stuff can get processed first.

I think there are some known bugs with this in WPF. I ran into a
similar problem last year working with the WPF version of SandDock.
Deserializing the window properties would not restore it from a
minimized position.
 
Cracked it! Added a call to the Activate method after the call to
Show.

Cheers,
Mark
--
|\ _,,,---,,_ A picture used to be worth a
ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
|,4- ) )-,_. ,\ ( `'-' came television!
'---''(_/--' `-'\_)

Mark Stevens (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
 
Back
Top