PC Review


Reply
Thread Tools Rate Thread

can i unminimize in code

 
 
Rachel Suddeth
Guest
Posts: n/a
 
      26th Sep 2005
Hi,

I have a singleton calculator form, that can be displayed (non-modal) from
any number of places in my ap (either by button clicks or special
keypresses.) We did it this way because it has some special features that
involve saving state, and it seemed easiest to just keep the thing around
since we'll never want more than one open at a time. The code to display it
currently looks like this:

public static void ShowPopup()
{
if(PopupCalculator != null)
{
PopupCalculator.Activate();
}
else
{
PopupCalculator = new SpecialCalculator();
PopupCalculator.Show();
}
}

The problem with this is that if the Calculor form is minimized, we'd like
the ShowPopup() to unminimize it. Right now the call to Activate() is just
highlighting the taskbar icon. Anyone know how to force it to unminimize in
code?

Thanks,
Rachel


 
Reply With Quote
 
 
 
 
Chris R. Timmons
Guest
Posts: n/a
 
      26th Sep 2005
"Rachel Suddeth" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Hi,
>
> I have a singleton calculator form, that can be displayed
> (non-modal) from any number of places in my ap (either by button
> clicks or special keypresses.) We did it this way because it has
> some special features that involve saving state, and it seemed
> easiest to just keep the thing around since we'll never want
> more than one open at a time. The code to display it currently
> looks like this:
>
> public static void ShowPopup()
> {
> if(PopupCalculator != null)
> {
> PopupCalculator.Activate();
> }
> else
> {
> PopupCalculator = new SpecialCalculator();
> PopupCalculator.Show();
> }
> }
>
> The problem with this is that if the Calculor form is minimized,
> we'd like the ShowPopup() to unminimize it. Right now the call
> to Activate() is just highlighting the taskbar icon. Anyone know
> how to force it to unminimize in code?


Rachel,

Set the window state to "Normal" before activating it:

PopupCalculator.WindowState = FormWindowState.Normal;
PopupCalculator.Activate();

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
 
Reply With Quote
 
=?Utf-8?B?Um9u?=
Guest
Posts: n/a
 
      26th Sep 2005
PopupCalculator.WindowState = FormWindowState.Normal;

"Rachel Suddeth" wrote:

> Hi,
>
> I have a singleton calculator form, that can be displayed (non-modal) from
> any number of places in my ap (either by button clicks or special
> keypresses.) We did it this way because it has some special features that
> involve saving state, and it seemed easiest to just keep the thing around
> since we'll never want more than one open at a time. The code to display it
> currently looks like this:
>
> public static void ShowPopup()
> {
> if(PopupCalculator != null)
> {
> PopupCalculator.Activate();
> }
> else
> {
> PopupCalculator = new SpecialCalculator();
> PopupCalculator.Show();
> }
> }
>
> The problem with this is that if the Calculor form is minimized, we'd like
> the ShowPopup() to unminimize it. Right now the call to Activate() is just
> highlighting the taskbar icon. Anyone know how to force it to unminimize in
> code?
>
> Thanks,
> Rachel
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linq to XML--Are there code examples that make Linq as easy as SQL? Or how can I convert ths simple pseudo code into real code? Reece Microsoft C# .NET 4 10th Dec 2008 03:13 AM
ATI Radeon Drivers - Code 43, Code 37 & Code 10 =?Utf-8?B?SmFrZQ==?= Windows Vista Hardware 14 29th Aug 2006 05:50 AM
what is the difference between code inside a <script> tag and code in the code-behind file? keithb Microsoft ASP .NET 1 29th Mar 2006 02:00 AM
[New] Zipoid - ZIP Code, City Name and Area Code Lookup - Zip Code to Zip Code Distance Calculation Mel Freeware 0 22nd Jul 2005 04:13 PM
Player wont unminimize mike Windows XP Music 0 16th Mar 2004 06:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:13 AM.