473,473 Members | 2,226 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

can i unminimize in code

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
Nov 17 '05 #1
2 3275
"Rachel Suddeth" <ra****@bldhound.com> wrote in
news:ez**************@TK2MSFTNGP10.phx.gbl:
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/
Nov 17 '05 #2
Ron
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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
4
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
16
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
5
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
18
by: Joe Fallon | last post by:
I have some complex logic which is fairly simply to build up into a string. I needed a way to Eval this string and return a Boolean result. This code works fine to achieve that goal. My...
37
by: Alan Silver | last post by:
Hello, Newbie here, so please forgive what is probably a basic question ... I see a lot of discussion about "code behind", which if I have understood correctly, means that the script code goes...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.