在 C# 托盘中拖放 NotifyIcon [英] drag and drop on NotifyIcon in tray in C#

查看:20
本文介绍了在 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆