drag and drop on NotifyIcon in tray in C#(在 C# 托盘中拖放 NotifyIcon)
问题描述
我正在尝试创建一个在托盘中运行的 C# 应用程序,我可以将文件放在它的图标上.有什么方法可以获取系统托盘图标上放置的文件的路径?System.Windows.Forms.NotifyIcon 没有任何与拖放相关的事件.
I am trying to create a C# application that runs in tray where I can drop files on it's icon. Is there any way to get the path of the file dropped on the System Tray icon? System.Windows.Forms.NotifyIcon does not have any events related to drag and drop.
推荐答案
不可能做到这一点,简单的方法.如果光标位于通知图标附近的特殊区域,您可以显示一个虚拟表单.dummy Form 可以获取被放置文件的文件路径.
it's not possible to do this, the easy way. You can show a dummy Form, if the cursor is in a special area near the notifyicon. The dummy Form can get the filepath of the droped file.
这篇关于在 C# 托盘中拖放 NotifyIcon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 C# 托盘中拖放 NotifyIcon


- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01
- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- 使用 rss + c# 2022-01-01
- 带问号的 nvarchar 列结果 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01
- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- 在 LINQ to SQL 中使用 contains() 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01
- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01