473,791 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding initial form in VB

I am writing a program that primaryly runs in the system tray. When the
program starts, I would like to hide the main form and only show the tray
icon.

in the Form Load event I set Me.Visible = False, but this does not hide the
form. In the Form Activate event, if I set the same thing, the form is
never displayed.

There has got to be an easy way to do that I am overlooking.

Thanks;
Michael
Nov 20 '05 #1
8 8003
Cor
Hi Michael,
Me.Windowstate= FormWindowState .minimized
Succes
Cor
Nov 20 '05 #2

"Michael Rich" <mr***@saleslog ix.com> wrote in message
news:e6******** ******@TK2MSFTN GP12.phx.gbl...
I am writing a program that primaryly runs in the system tray. When the
program starts, I would like to hide the main form and only show the tray
icon.

in the Form Load event I set Me.Visible = False, but this does not hide the form. In the Form Activate event, if I set the same thing, the form is
never displayed.

There has got to be an easy way to do that I am overlooking.


Why don't you create a class for your system tray icon and create an
instance of this on startup instead of your form? You'll need to set your
startup object to Sub Main and initialise your class from there.

HTH.
Nov 20 '05 #3
I asked the same question a few months back.
The solution is to set your apps startup object as Sub Main()

Sub Main()
Dim frm As Form = New Form1()
Application.Run ()
End Sub

After Main() has executed, your Form1 with the NotifyIcon component exists
but is not yet visible.
--
Shayne H
Nov 20 '05 #4
"Michael Rich" <mr***@saleslog ix.com> schrieb
I am writing a program that primaryly runs in the system tray. When
the program starts, I would like to hide the main form and only show
the tray icon.

in the Form Load event I set Me.Visible = False, but this does not
hide the form. In the Form Activate event, if I set the same thing,
the form is never displayed.

There has got to be an easy way to do that I am overlooking.


Don't use a startup form. Use a sub main. There, you can either only show
the tray icon, or create the try icon and create the form without showing
it.
--
Armin

Nov 20 '05 #5
Cor
Hi Armin,
I become curious, there are so many answers after I gave early this morning
the advise to use
Me.Windowstate= FormWindowState .minimized
That I think, what is wrong with that (no critique feel free to add when I
post something can only add my knowledge)
Or has this to do with some time lags between newsservers?
Cor
Nov 20 '05 #6
"Cor" <no*@non.com> schrieb
Hi Armin,
I become curious, there are so many answers after I gave early this
morning the advise to use
Me.Windowstate= FormWindowState .minimized
That I think, what is wrong with that (no critique feel free to add
when I post something can only add my knowledge)
Or has this to do with some time lags between newsservers?
Cor


As often I don't understand you. :-/ Do you wonder why there are posts after
yours or why the suggestions are different?
--
Armin

Nov 20 '05 #7
Hello,

"Cor" <no*@non.com> schrieb:
I become curious, there are so many answers after I gave
early this morning the advise to use
Me.Windowstate= FormWindowState .minimized
That I think, what is wrong with that (no critique feel free to add when I
post something can only add my knowledge)
Or has this to do with some time lags between newsservers?


Ng communication is asynchronous. Some people download the new messages
only 1-3 times per day, write the answers and upload them when downloading
the new messages the next time. That's why some people may not see your
reply when writing their answer.

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #8
Cor
No Armin,
I was wondering if there was a error in my message.
Because I did n't see it repeated and I am not that clever.

But Herfried has given the answer
Cor

Nov 20 '05 #9

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

Similar topics

4
5191
by: web_design | last post by:
I put this together from some other scripts I am using on a site. I'm trying to make a better email hiding script. It isn't working. Also, it causes Internet Explorer 6 SP2 to block the script as "active content". :( The idea is that if the user doesn't have JavaScript enabled, they will see an image of the email address (that can't be read by email harvesting programs). If JavaScript is enabled, the image will be hidden and the...
7
6903
by: Danielb | last post by:
I want my application to run most of the time as just an notify icon visible in the system tray, with some dialogs windows that open if the user selects an option from the context menu on the tray icon. I've had a look at the example on code project that creates an application that runs in the system tray: http://www.codeproject.com/csharp/desktop_mail_checker.asp So I copied how the above article sets up the main form: the form's...
22
2195
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said stage. One approach I have used on other systems is to prevent the action buttons appearing. For example, if one did not have the Role of Administrator, one would be prevented from deleting a ticket not created by oneself. However, it did occur...
5
3997
by: Ivan | last post by:
I am used to VB6 and am not sure how to do this in Vstudio .NET. I have a main form which calls other forms. I want to disable that main form while other ones are called. I tried hiding it and creating a new instance of the main form when returning to it but than my application is just creating more forms. How do I hide the main form and return back to it when exiting another form?
4
1908
by: Tony Vitonis | last post by:
Hello. I've written an app that I want to "live" in the system tray. I want it to start up with just a tray icon showing, and if the user selects "Settings..." from the icon's context menu, to display a window that will allow him to change settings. When he hits "OK" or "Cancel", the window should hide again. At first, I tried putting a "Me.Visible = False" in the form's Load event, but apparently that code runs before the command can...
24
5871
by: Kourosh | last post by:
I have a lot of DIV tags on an HTML page. I want to group some of them so that I can hide them all together at once if needed. What's a good way to do this? I want this to be compatible with at least IE 5. Would it be a good idea to assign all DIV tags in the same group the same "title" attribute? This is what I want to do, but I'm not sure if it's the correct approach, and I'm not sure how to set the style with javascript either: ...
11
2965
by: Kevin | last post by:
I've got a timer on my MDI parent form. If there's no mouse movement for a set number of minutes, the Visible property of all open forms is set to False and the Log On form is displayed. I could do it in VB6. In VB2005 I can get a list of all the open forms, but I get an error after hiding the first one. This is what I'm trying to use: For Each m In My.Application.OpenForms
11
3184
by: Alex | last post by:
Hello all, I have a main form(say "form1") .i want to display another form(say "form2") on occuring of an event (say a button click) and want to hide it after some time so that it will again displays while occuring of the same event.I develop it by creating an object of the form2 and displays it in the event by calling form2.Show() and hide it by calling form2.Hide(). the problem is that while displaying the form2 the memory usage of...
1
1382
by: jack | last post by:
Hi all, My datagrid have too many columns which are going out of screen. one of the solution is to group the columns and make only the total column visible at the initial stage. What now i want to do is hiding and unhiding the column at the run time without the post back to the server. have anyone come across with such a kind of scenario please do suggest
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5430
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.