Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在运行程序中执行方法,而不是启动新实例_C#_Windows_Winforms_Windows 7_Taskbar - Fatal编程技术网

C# 在运行程序中执行方法,而不是启动新实例

C# 在运行程序中执行方法,而不是启动新实例,c#,windows,winforms,windows-7,taskbar,C#,Windows,Winforms,Windows 7,Taskbar,我正在写一份天气申请表。我正在将它与任务栏集成。当您右键单击任务栏上的图标时,它会显示当前温度等。如果您单击显示“当前:…”的文本,它会打开应用程序的另一个实例 截图: 如何让它在我的程序中运行过程或函数?因此,如果用户单击“Current:…”,它应该在同一应用程序中打开一个新表单。它不应该打开另一个应用程序 我的代码当前为: JumpListCustomCategory userActionsCategory = new JumpListCustomCategory("Weather");

我正在写一份天气申请表。我正在将它与任务栏集成。当您右键单击任务栏上的图标时,它会显示当前温度等。如果您单击显示“当前:…”的文本,它会打开应用程序的另一个实例

截图:

如何让它在我的程序中运行过程或函数?因此,如果用户单击“Current:…”,它应该在同一应用程序中打开一个新表单。它不应该打开另一个应用程序

我的代码当前为:

JumpListCustomCategory userActionsCategory = new JumpListCustomCategory("Weather");
userActionLink.Arguments = "-1";
JumpListLink userActionLink = new JumpListLink(Assembly.GetEntryAssembly().Location, Conditions + ": " + reader.ReadToEnd());
userActionLink.IconReference = new IconReference(testicon, 0);
userActionsCategory.AddJumpListItems(userActionLink);
list.AddCustomCategories(userActionsCategory);
list.Refresh();

看这里:。它将允许您仅打开一个程序实例,但使用VisualBasic而不是互斥锁。

您是否正在查找
NotifyIcon
?Hi L.B否如果右键单击,我想使用windows 7任务栏向用户显示当前温度。然后,当用户单击文本时,程序应在同一应用程序中打开一个新表单。目前它打开了一个新的应用程序。嗨,joostehost,不确定这是否有帮助,但我第一次想到的是:不是真的,我需要打开一个带有跳转列表的新表单。