Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C# Programming

C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-30-2006, 08:14 PM
NeedHelp NeedHelp is offline
Programming God
 
Join Date: May 2006
Posts: 527
Rep Power: 12
NeedHelp is on a distinguished road
Default Hide form on startup?

How do you hide form1 on startup? I have an application where I have a notifyicon and don't want to display the main form (although the notifyicon is in the form1 on load). I used

Code:
this.visible = false;
which did not work at all. I know this can be done in C++ (I think).
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-31-2006, 08:50 PM
NeedHelp NeedHelp is offline
Programming God
 
Join Date: May 2006
Posts: 527
Rep Power: 12
NeedHelp is on a distinguished road
Default

Also, when I minimize my form on startup it shows up minimized above the start button. This is if I have the "show in taskbar" set to false.

Any ideas?
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-31-2006, 09:06 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Age: 26
Posts: 5,846
Last Blog:
Performance or Maintai...
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

I've seen this problem before. You can do this:

On Form Load:
Code:
this.opacity = 0;
and then when you want to display it
Code:
this.opacity = 1;
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-31-2006, 09:10 PM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Rep Power: 10
brackett is on a distinguished road
Default

You could do this.WindowState = WindowState.Minimized, which will minimize the form, but show it in the taskbar. By setting this.ShowInTaskbar to False, you'll get rid of the task, but it can still be gotten to via Alt-Tab.

The better way to do this would be to use a void Main() as a startup. Then, you can either just show the TrayIcon, or control what forms are shown.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-01-2006, 11:11 AM
NeedHelp NeedHelp is offline
Programming God
 
Join Date: May 2006
Posts: 527
Rep Power: 12
NeedHelp is on a distinguished road
Default

Quote:
Originally Posted by brackett View Post
You could do this.WindowState = WindowState.Minimized, which will minimize the form, but show it in the taskbar. By setting this.ShowInTaskbar to False, you'll get rid of the task, but it can still be gotten to via Alt-Tab.
This is what I had originally and it shows a little box above the start button. Looks really bad like a minimized form in an MDI.

How do I use void main as startup?
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 09-01-2006, 06:29 PM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Rep Power: 10
brackett is on a distinguished road
Default

The little box above the start button sounds like an OS/shell problem - that shouldn't happen.

You can switch to void main() as your startup method in the Properties of the Project, I believe.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-02-2006, 09:44 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Age: 26
Posts: 5,846
Last Blog:
Performance or Maintai...
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

I was able to replicate the program just now. Not sure why it shows a little box there but if you follow the steps above that will happen. If you set the form to minimized in the properties it will not show but if you return it to normal it shows as the box instead of showing the "normal" state form.

Not sure if this is a bug or what. I'd go with brackett's suggestion and switch it to void main().
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-02-2006, 05:28 PM
Nightracer's Avatar   
Nightracer Nightracer is offline
Programmer
 
Join Date: Jun 2006
Posts: 130
Rep Power: 9
Nightracer is on a distinguished road
Default

I always thought that the this.visible = false would hide the form. Is this not true?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding a change password form InternetGeek Visual Basic Programming 11 02-16-2008 01:53 PM
Lost form InternetGeek Visual Basic Programming 3 02-10-2007 05:26 PM
Run code on startup? CheeseBurgerMan Visual Basic Programming 7 07-28-2006 04:00 PM
Calling a form from another form Void Managed C++ 1 07-01-2006 09:44 AM


All times are GMT -5. The time now is 09:10 PM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 65%

Ads