| | |
C#,system tray, wont go from task bar.
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2005
Posts: 1
Reputation:
Solved Threads: 0
hello people 
found this site via google and its helped me a great deal so far but ive hit a snag.
from this topic:
http://www.daniweb.com/techtalkforums/thread19672.html
ive managed to create an app that will sit in the system tray and can be minimised and restroed again but the problem is it wont disepear from the task bar. being a complete begginner at this stuff i have no idea where to look.
i was wondering if anyone can help me heres my code:
i added this to the onload procedure, great it works but it just moves the app so its floating above the start menu which is no good to me
anyone have any idea idea what could be up
im sure its pretty simple but i cant see it
many thanks
adam

found this site via google and its helped me a great deal so far but ive hit a snag.
from this topic:
http://www.daniweb.com/techtalkforums/thread19672.html
ive managed to create an app that will sit in the system tray and can be minimised and restroed again but the problem is it wont disepear from the task bar. being a complete begginner at this stuff i have no idea where to look.
i was wondering if anyone can help me heres my code:
C# Syntax (Toggle Plain Text)
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace WindowsApplication2 { /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.NotifyIcon notifyIcon1; private System.ComponentModel.IContainer components; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_Click); this.SuspendLayout(); // // TODO: Add any constructor code after InitializeComponent call // } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); // // notifyIcon1 // this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); this.notifyIcon1.Text = "notifyIcon1"; this.notifyIcon1.Visible = true; this.notifyIcon1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDown); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(292, 266); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void notifyIcon1_Click(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) this.Show(); this.WindowState = FormWindowState.Normal; this.Activate(); notifyIcon1.Visible=true; //if you want to remove from tray when clicked on } private void Form1_Load(object sender, System.EventArgs e) { this.Hide(); notifyIcon1.Visible=true; } private void notifyIcon1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { } } }
i added this to the onload procedure, great it works but it just moves the app so its floating above the start menu which is no good to me
C# Syntax (Toggle Plain Text)
this.ShowInTaskbar = false;
anyone have any idea idea what could be up
im sure its pretty simple but i cant see it
many thanks
adam
•
•
Join Date: Jun 2006
Posts: 1
Reputation:
Solved Threads: 0
Try this site
under small problem, you may need to use dispose, not sure
http://www.codeproject.com/csharp/trayiconmenu01.asp
under small problem, you may need to use dispose, not sure
http://www.codeproject.com/csharp/trayiconmenu01.asp
![]() |
Similar Threads
- new laptop (Networking Hardware Configuration)
- Virus Alert Icon in System Tray HELP! (Viruses, Spyware and other Nasties)
- System Tray On Bottom Of Screen (Windows NT / 2000 / XP)
- Task bar with start button is missing (Windows NT / 2000 / XP)
Other Threads in the C# Forum
- Previous Thread: Blogs About C# or .net
- Next Thread: Embedding a spreadsheet and chart into a windows form
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access algorithm array barchart bitmap box buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





