Problem restoring window - WPF


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".
 
Ad

Advertisements

N

not_a_commie

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.
 
Ad

Advertisements

M

Mark Stevens

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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top