473,504 Members | 13,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ShowInTaskbar Causing Blank Form/Hang

I have a winforms application that is hidden using the following code
upon prompt:

//Remove from the taskbar and also from alt+tab
this.Visible = false;
this.ShowInTaskbar = false;
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;

Upon correct DDE prompt from another application my application should
show itself in normal state with an icon in the taskbar.

this.Show();
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.Focus();
//this.ShowInTaskbar = true;
LoadFormData();

Problem: If I do not comment out this.ShowInTaskbar = true when
re-opening my form just hangs. I cannot even access maximize or
minimize buttons. If I comment out this.ShowInTaskbar everything seems
to work correctly EXCEPT there is nothing in the taskbar. I have tried
changing the order of the calls for a show but nothing seems to help.

Any suggestions on what might be occurring and how to resolve it would
be accepted with relish!

Mike

Apr 27 '06 #1
4 2781
All,

I commented out this.ShowInTaskbar in both the hide and show sections
and the application appears to behave correctly now. I might add that
I also had to use the bugfix here
http://support.microsoft.com/default...B;EN-US;327154 to
correct my toolbar problem. I believe there may have been some
interaction between these two issues that caused the problem.

Mike

Apr 27 '06 #2
On 27 Apr 2006 12:42:45 -0700, Mike wrote:
I have a winforms application that is hidden using the following code
upon prompt: [...] Upon correct DDE prompt from another application my application should
show itself in normal state with an icon in the taskbar. [...] Problem: If I do not comment out this.ShowInTaskbar = true when
re-opening my form just hangs. I cannot even access maximize or
minimize buttons. If I comment out this.ShowInTaskbar everything seems
to work correctly EXCEPT there is nothing in the taskbar. I have tried
changing the order of the calls for a show but nothing seems to help.


Just an idea out of the blue: are you sure that both the code that hide
your form and the one that shows your form again are executed in the UI
thread of your application?
Apr 28 '06 #3
Hi Mehdi,

No, I'm not sure. How would you advise I check? Thanks much.

Mike

Apr 28 '06 #4
On 28 Apr 2006 10:39:36 -0700, Mike wrote:
No, I'm not sure. How would you advise I check? Thanks much.


The easiest way to check that is to check the value of the InvokeRequired
property of your form. If it returns false, this means that you are in the
UI thread and that you can safely call its methods.

If it returns true however this means that you are not in the UI thread and
that, as stated in the documentation, you should first marshall the call to
the UI thread using the Control.Invoke or Control.BeginInvoke methods
before accessing any method or property of a UI control.
Apr 28 '06 #5

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

Similar topics

0
1306
by: ptass | last post by:
I have a main form (Form1) which opens a second form (Form2) when a button is clicked. Form2 has .FormBorderStyle set to FixedSingle. Form2 contains two buttons, one which unpins it from Form1...
14
2605
by: charlie_M | last post by:
Is there a way to blank the screen in a FORM's onsubmit=... to blank the screen for the user?? I asked this before and got a way to blank a table by id with ...
6
3171
by: Cro | last post by:
Dear Access Developers, The 'Allow Additions' property of my form is causing unexpected results. I am developing a form that has its 'Default View' property set to 'Continuous Forms' and am...
10
2381
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
2
7175
by: Claire | last post by:
Ive an application that usually runs in the taskbar. ShowInTaskbar is set to false during InitializeComponent. It works fine. However, I decided that i'd like the application to show in the task...
0
1905
by: Machi | last post by:
I am using C#.NET. API version showintaskbar form Window taskbar hide show not fire events MouseLeave and MouseEnter! Now i am facing a critical problem for MouseLeave and MouseEnter event when i...
3
1489
by: Mitchell Vincent | last post by:
I can't find the post now but several months back I posted a problem I was having using the WebBrowser control when trying to have a systray icon pop back up a window that hadn't been shown in the...
0
983
by: Grant Schenck | last post by:
Hello, I have a listview with around 5000 entries. It works fine. However, because my form is associated with a tray icon, when I am minimized I set the ShoreInTaskbar = false to hide my self...
4
1792
vdraceil
by: vdraceil | last post by:
Hi everyone.. I wanted to give my form a fullscreen view(without the title bar),so i set the following properties of the form, windowstate=vbmaximized caption="" controlbox=false...
0
7213
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
7298
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
7366
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
7017
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
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
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
5026
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
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.