473,324 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Window Activiation Causes Controls to Disappear


I have a tiny little application that runs, and when minimized it throws
itself into the systray until the user double clicks on the systray
icon. To accomplish that first part I have this :

Private Sub frmMain_Resize(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles MyBase.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.Visible = False
Me.ShowInTaskbar = False
End If
End Sub

... I hope that is correct, it does seem to work.

To show the window again on double click of the icon I have :

Private Sub NotifyIcon1_DoubleClick(ByVal sender As Object, ByVal e
As System.EventArgs) Handles NotifyIcon1.DoubleClick

Me.Visible = True
Me.ShowInTaskbar = True
Me.Activate()

If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If

End Sub

However, the panel and the 2 web browser controls on the panel are
hidden and never show up again..

What am I doing (or not doing!)?

--
- Mitchell
Nov 21 '05 #1
10 1187
Hi

Thanks for using Microsoft MSDN Managed Newsgroup. My name is Peter, and I
will be assisting you on this issue.
First of all, I would like to confirm my understanding of your issue.
From your description, I understand that after minimized the app into
systray and reactive it the component on the form is invisible.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may try the code below.
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.Visible = False
Me.ShowInTaskbar = False
End If
End Sub
Private Sub NotifyIcon1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles NotifyIcon1.DoubleClick
Me.ShowInTaskbar = True
Me.Visible = True
Me.Activate()

If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If
End Sub

Also I think the Me.Visible = False is not necessary you may try to comment
out it to see if that met your request.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #2
Peter Huang [MSFT] wrote:
Also I think the Me.Visible = False is not necessary you may try to comment
out it to see if that met your request.

Best regards,

Peter Huang
Microsoft Online Partner Support


Yes, Peter, you understood my question exactly and your suggestion
worked! The Window now appears normally when it is restored. However,
this seems to have caused another problem. When I set ShowInTaskBar to
false, it still shows some kind of "ghost" window on the taskbar. It
does not react when clicked but every time the app is minimized (and an
icon put in the systray) it appears. Is there some other trick to
getting it to not show in the taskbar other than me.ShowInTaskbar = False ?

THANKS!

--
- Mitchell
Nov 21 '05 #3
Hi

Thanks for your quickly reply!

So far the ShowInTaskbar is the managed way to do control if the windows
showed in taskbar.
Also can you provide a simple reproduce sample, compress to a zip file and
add it as an attachment in the newsgroup so that I can do further
troubleshooting and try to find how to workaround the problem.

Thanks!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #4
Hi

Thank for your reproduce sample.
I can reproduce the problem with your code.
So far as a workaround I think we may try to set the ShowInTaskBar property
to false in the design time and change the code as below.
Dim loginURL As String = "http://www.google.com"

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AxWebBrowser1.Navigate2(loginURL)
End Sub

Private Sub frmMain_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Resize
'If Me.WindowState = FormWindowState.Minimized Then
' Me.Visible = False
' Me.ShowInTaskbar = False
'End If
End Sub

Private Sub NotifyIcon1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles NotifyIcon1.DoubleClick
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If
Me.Activate()
End Sub

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5
Peter Huang [MSFT] wrote:
Hi

Thank for your reproduce sample.
I can reproduce the problem with your code.
So far as a workaround I think we may try to set the ShowInTaskBar property
to false in the design time and change the code as below.


Thanks Peter, I appreciate you looking at this.. However, I would really
like to keep the software in the taskbar until it is minimized, just to
keep the "standard". That is the simplest example I could find and it
doesn't seem to work. Is no one using .NET to do this? Seems like a
pretty big bug to me!

Thanks again!

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com
Nov 21 '05 #6
Hi

Thanks for your quickly reply!

So far we are researching the issue, and we will update you with new
information ASAP.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #7
Hi

I reviewed the thread and find that there is a similar issue in the
newsgroup below.Now our colleague has replied to you, you may go and take a
look.
Subject: ShowInTaskBar = False just doesn't work?
Newsgroups: microsoft.public.dotnet.general

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #8
Peter Huang [MSFT] wrote:
Hi

I reviewed the thread and find that there is a similar issue in the
newsgroup below.Now our colleague has replied to you, you may go and take a
look.
Subject: ShowInTaskBar = False just doesn't work?
Newsgroups: microsoft.public.dotnet.general

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


They've pointed me in the right direction for sure! I'm waiting on some
additional information on that thread. I might have to leave .NET for
this because of the lack of control for ActiveX controls, but we'll see..

Thanks Peter!

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com
Nov 21 '05 #9
Hi

You are welcome! :)

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #10
Hi

You are welcome! :)

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #11

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

Similar topics

9
by: Justin Koivisto | last post by:
Is there a way to create an alert-like message box that uses a custom image? Basically, I want to replace the default ! image with something else. -- Justin Koivisto - spam@koivi.com PHP...
4
by: Brad Jones | last post by:
<Previously posted in microsoft.public.dotnet.framework.windowsforms> Hi all. Any suggestions here would be appreciated. Thanks for reading. I'm primarly a C++ developer but I've been trying to...
9
by: Rathtap | last post by:
I want to popup a window from my codebehind. The reason is that during the postback the code needs to do some validations and to build the arguments that are passed in the url. How can I achieve...
2
by: ari | last post by:
I have a small form that comprises a toolbar, a treeview and a status bar. Everything was working fine until I decided to add a new button to the toolbar - and I decided for appearances sake to...
3
by: Fred Flintstone | last post by:
I'm a bit confused about something. I have an aspx page populated with dynamic controls; textboxes, labels, radios and so on. On the page is a Yes/No radio combination and 3 textboxes. The...
5
by: Mitchell Vincent | last post by:
A picture says a thousand words, so here are 2! Design Time: http://www.ksoftware.net/examples/Clip1.jpg Run Time: http://www.ksoftware.net/examples/Clip2.jpg The problems started when I...
37
by: Jan Tovgaard | last post by:
Hey everyone:) We have a critical problem, which I can see that other people also has ran into. In Internet Explorer 7 it is no longer possible to do a window.close after opening a window,...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
10
by: themightypea | last post by:
Hi, I'm attempting to create a continuos form which allow the user to edit various fields for each item. Unfortunately, the data I need is spread over multiple tables so binding the control to the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.