Article View: alt.pl.comp.lang.csharp
Article #208Re: Chowanie programu do traya
From: Selvin
Date: Fri, 21 Nov 2003 07:11
Date: Fri, 21 Nov 2003 07:11
93 lines
3145 bytes
3145 bytes
u mnie dziala
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication3
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.NotifyIcon notifyIcon1;
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.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.DoubleClick += new
System.EventHandler(this.notifyIcon1_DoubleClick);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Name = "Form1";
this.ShowInTaskbar = false;
this.Text = "Form1";
this.Resize += new System.EventHandler(this.Form1_Resize);
}
#endregion
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Resize(object sender, System.EventArgs e)
{
if(this.WindowState == System.Windows.Forms.FormWindowState.Minimized)
this.Visible = false;
else
this.Visible = true;
}
private void notifyIcon1_DoubleClick(object sender, System.EventArgs e)
{
this.Visible = true;
this.WindowState = System.Windows.Forms.FormWindowState.Normal;
}
}
}
jak by nie dzialalo to pewnie wina tego za ja mam win >= 5.0 a ty nie
(win98)
pozdrawiam
Przemek Sulikowski
Technical Details
Message-ID:
<bpkdgv$guv$1@news.onet.pl>Path:
mbox-mo1.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mailReferences:
<bpis73$gj5$1@inews.gazeta.pl> <bpismf$1a5$1@news.onet.pl> <bpja82$9pp$1@inews.gazeta.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail From: "Selvin" <selvin...@nospam_osadkowski.com.pl> Newsgroups: alt.pl.comp.lang.csharp Subject: Re: Chowanie programu do traya Date: Fri, 21 Nov 2003 08:11:33 +0100 Organization: news.onet.pl Lines: 95 Sender: selvin@poczta.onet.pl@217.97.163.77 Message-ID: <bpkdgv$guv$1@news.onet.pl> References: <bpis73$gj5$1@inews.gazeta.pl> <bpismf$1a5$1@news.onet.pl> <bpja82$9pp$1@inews.gazeta.pl> NNTP-Posting-Host: 217.97.163.77 X-Trace: news.onet.pl 1069398367 17375 217.97.163.77 (21 Nov 2003 07:06:07 GMT) X-Complaints-To: ab...@onet.pl NNTP-Posting-Date: 21 Nov 2003 07:06:07 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit