Click here to Skip to main content
15,896,338 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows services???? Pin
Nish Nishant23-May-02 21:20
sitebuilderNish Nishant23-May-02 21:20 
GeneralRe: Windows services???? Pin
Rickard Andersson2023-May-02 22:17
Rickard Andersson2023-May-02 22:17 
GeneralRe: Windows services???? Pin
Nish Nishant23-May-02 22:17
sitebuilderNish Nishant23-May-02 22:17 
GeneralRe: Windows services???? Pin
A.A.29-May-02 17:20
A.A.29-May-02 17:20 
QuestionNotifyIcon and ContextMenu Bug ?? Pin
2sky23-May-02 1:28
2sky23-May-02 1:28 
AnswerRe: NotifyIcon and ContextMenu Bug ?? Pin
Nish Nishant23-May-02 1:34
sitebuilderNish Nishant23-May-02 1:34 
GeneralRe: NotifyIcon and ContextMenu Bug ?? Pin
23-May-02 1:57
suss23-May-02 1:57 
GeneralRe: NotifyIcon and ContextMenu Bug ?? Pin
2sky23-May-02 2:05
2sky23-May-02 2:05 
If you make sure the trayicons' "Icon" property is set to a valid icon, you should be able to copy-paste the code below in an empty C# project:


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace NotifyMenu
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.NotifyIcon TrayIcon;
private System.Windows.Forms.ContextMenu MnuContext;
private System.Windows.Forms.MenuItem MnuItem1;
private System.Windows.Forms.MenuItem MnuItem2;
private System.ComponentModel.IContainer components;

public Form1()
{
InitializeComponent();
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.TrayIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.MnuContext = new System.Windows.Forms.ContextMenu();
this.MnuItem1 = new System.Windows.Forms.MenuItem();
this.MnuItem2 = new System.Windows.Forms.MenuItem();
//
// TrayIcon
//
this.TrayIcon.ContextMenu = this.MnuContext;
this.TrayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("TrayIcon.Icon")));
this.TrayIcon.Text = "NotifyMenu Tray";
this.TrayIcon.Visible = true;
//
// MnuContext
//
this.MnuContext.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.MnuItem1});
//
// MnuItem1
//
this.MnuItem1.Index = 0;
this.MnuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.MnuItem2});
this.MnuItem1.Text = "Item 1";
this.MnuItem1.Popup += new System.EventHandler(this.MnuItem1_Popup);
//
// MnuItem2
//
this.MnuItem2.Index = 0;
this.MnuItem2.Text = "Item 2";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.ContextMenu = this.MnuContext;
this.Name = "Form1";
this.Text = "Form1";

}
#endregion

[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void MnuItem1_Popup(object sender, System.EventArgs e)
{
MessageBox.Show(this, "Event Fired");
}
}
}
GeneralComponent staying alive Pin
Oyvind Bratland22-May-02 20:32
Oyvind Bratland22-May-02 20:32 
GeneralAny sources of C# Pin
dlhson22-May-02 16:47
dlhson22-May-02 16:47 
GeneralRe: Any sources of C# Pin
Nick Parker22-May-02 17:25
protectorNick Parker22-May-02 17:25 
GeneralRe: Any sources of C# Pin
Nish Nishant22-May-02 18:18
sitebuilderNish Nishant22-May-02 18:18 
GeneralRe: Any sources of C# Pin
Rickard Andersson2022-May-02 21:07
Rickard Andersson2022-May-02 21:07 
GeneralRe: Any sources of C# Pin
Nish Nishant22-May-02 21:21
sitebuilderNish Nishant22-May-02 21:21 
GeneralRe: Any sources of C# Pin
SimonS24-May-02 3:36
SimonS24-May-02 3:36 
QuestionAwsome Fade-in effect? Pin
Brian Olej22-May-02 15:32
Brian Olej22-May-02 15:32 
AnswerRe: Awsome Fade-in effect? Pin
Nick Parker22-May-02 17:29
protectorNick Parker22-May-02 17:29 
GeneralRe: Awsome Fade-in effect? Pin
Brian Olej23-May-02 9:56
Brian Olej23-May-02 9:56 
GeneralMaintain state in checkboxes inside datagrid Pin
22-May-02 9:33
suss22-May-02 9:33 
GeneralSendMessage() Pin
Rickard Andersson2022-May-02 6:51
Rickard Andersson2022-May-02 6:51 
GeneralRe: SendMessage() Pin
James T. Johnson22-May-02 8:56
James T. Johnson22-May-02 8:56 
GeneralRe: SendMessage() Pin
Rickard Andersson2022-May-02 9:58
Rickard Andersson2022-May-02 9:58 
GeneralRe: SendMessage() Pin
Rickard Andersson2022-May-02 10:29
Rickard Andersson2022-May-02 10:29 
GeneralRe: SendMessage() Pin
James T. Johnson22-May-02 14:32
James T. Johnson22-May-02 14:32 
GeneralRe: SendMessage() Pin
Rickard Andersson2022-May-02 21:17
Rickard Andersson2022-May-02 21:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.