PDA

View Full Version : نحوه قرار دادن آیکون برنامه در system try



hassan_kahrizy
جمعه 02 اردیبهشت 1384, 00:04 صبح
بسمه تعالی
سلام علیکم :flower:

چطور می شود آیکون برنامه در system tryقرار داد
و یا اینکه وقتی minimizeمی کنیم در system try قرار گیرد
با تشکر

محمد میرمصطفی
جمعه 02 اردیبهشت 1384, 01:53 صبح
با کمک کامپونت NotifyTray

hassan_kahrizy
جمعه 02 اردیبهشت 1384, 06:17 صبح
بسمه تعالی
سلام :flower:
با تشکر از لطفتون :flower:
می شه بیشتر درباره این کنترل توضیح بدید
و چطور می شه برای این آیکون یکcontext menueقرار داد
با تشکر :flower:

محمد میرمصطفی
شنبه 03 اردیبهشت 1384, 00:27 صبح
تو InitializeCoomponent بنویس:

private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager( typeof( Form1 ) );
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon( this.components );
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip( this.components );
this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
//
// notifyIcon1
//
this.notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
this.notifyIcon1.Icon = ( (System.Drawing.Icon) ( resources.GetObject( "notifyIcon1.Icon" ) ) );
this.notifyIcon1.Visible = true;
//
// contextMenuStrip1
//
this.contextMenuStrip1.AllowDrop = true;
this.contextMenuStrip1.Items.AddRange( new System.Windows.Forms.ToolStripItem[] {
this.closeToolStripMenuItem
} );
this.contextMenuStrip1.Location = new System.Drawing.Point( 23, 61 );
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size( 122, 52 );
this.contextMenuStrip1.Visible = true;
//
// closeToolStripMenuItem
//
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
this.closeToolStripMenuItem.SettingsKey = "Form1.closeToolStripMenuItem";
this.closeToolStripMenuItem.Text = "&Close";
this.closeToolStripMenuItem.Click += new System.EventHandler( this.closeToolStripMenuItem_Click );
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size( 5, 14 );
this.ClientSize = new System.Drawing.Size( 292, 266 );
this.Name = "Form1";
this.Text = "Form1";
this.contextMenuStrip1.ResumeLayout( false );

}

و متد زیر رو هم به کدت اضافه کن.

private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}

hassan_kahrizy
یک شنبه 04 اردیبهشت 1384, 10:25 صبح
بسمه تعالی
سلام علیکم
با تشکر از محبتتون
خیلی ممنون :flower: :flower: :flower: