使用notifyIcon控件调试时任务栏出现2个相同图标
调试结果就是下图这样的:把鼠标放到图标上也不会消失!
我新手一个,正在学习跨类调用控件和事件,所以我自己创建了一个class1.cs文件
下面这个是class.cs文件的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
class Class1
{
public static void ceshi()
{
Form1 f1 = new Form1();
f1.notifyIcon1.Text = "测试测试测试";
}
}
}
上个图片:
下面这个是form1.cs的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Class1.ceshi();
}
}
}
上个图片:
求大神们行行好,帮帮忙,已经困惑我很久了!
小白再弱弱的问个问题:
上图中,c#的图表控件能解决2个球之间的连线吗?还是只能用gdi画? --------------------编程问答-------------------- 终于把帖子编辑完了,沙发自己坐 --------------------编程问答-------------------- 这个帖子有大神出没吗? --------------------编程问答-------------------- 第一个问题你要在代码中添加限制的你的程序只运行一次了。实现看看这个:http://www.cnblogs.com/zhili/p/OnlyInstance.html --------------------编程问答--------------------
我其实只运行了一次~~病没有重复运行 --------------------编程问答-------------------- 怎么没有人呐~~~ --------------------编程问答-------------------- private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
{
notifyIcon1.Dispose();
System.Environment.Exit(System.Environment.ExitCode);
this.Dispose();
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (this.Visible == false)
this.notifyIcon1.Icon = trayIco;
this.WindowState = FormWindowState.Normal;
this.Show();
this.BringToFront();
this.Activate();//激活当前程序为活动窗口
} --------------------编程问答--------------------
哥哥 不行啊 图标更多了
补充:.NET技术 , C#