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


基础教程推荐
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01