如何在vb.net 2008中Winodws代理的右键单击事件上创建弹出菜单? [英] How To Create Pop Up menu on Right click event of winodws agent in vb.net 2008?
本文介绍了如何在vb.net 2008中Winodws代理的右键单击事件上创建弹出菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友!
我已经在应用程序中加载了一个胜利特工merlin.现在我需要为代理的右键单击事件添加代码,以便可以打开一个弹出菜单,我可以在其中放置帮助文件...
外面有人知道vb.net中该弹出菜单的代码吗?
在此先感谢:)
Hello friends!!
I have loaded a win agent merlin in my app.. n its running good. now i need to add code for right click event of agent so that a pop up menu can open where i can put my help files ...
Anyone out there knows the code for that pop up menu in vb.net ?
Thanks in advance :)
推荐答案
您的意思是上下文菜单?
是的,我的意思是当我确实在代理上单击鼠标右键时,它将像在我们右键单击并创建新的forlder时一样在右键单击上显示一个菜单:|
yes i mean when i do right click on the agent than it will show a menu on right click just like when we do right click and create a new forlder :|
使用上下文菜单...
在菜单中添加创建文件夹"项.
然后尝试使用此代码..
''指定要操作的目录.
昏暗的路径As String ="c:\ MyDir"
试试
''确定目录是否存在.
如果Directory.Exists(path)然后
Console.WriteLine(该路径已经存在.")
返回
如果结束
''尝试创建目录.
Dim di As DirectoryInfo = Directory.CreateDirectory(path)
Console.WriteLine(目录已在{0}处成功创建.",Directory.GetCreationTime(path))
''删除目录.
di.Delete()
Console.WriteLine(目录已成功删除.")
异常捕获
Console.WriteLine(处理失败:{0}.",e.ToString())
结束尝试
use the Context Menu...
Add a "Create Folder" item in the menu.
then try this codes..
'' Specify the directory you want to manipulate.
Dim path As String = "c:\MyDir"
Try
'' Determine whether the directory exists.
If Directory.Exists(path) Then
Console.WriteLine("That path exists already.")
Return
End If
'' Try to create the directory.
Dim di As DirectoryInfo = Directory.CreateDirectory(path)
Console.WriteLine("The directory was created successfully at {0}.", Directory.GetCreationTime(path))
'' Delete the directory.
di.Delete()
Console.WriteLine("The directory was deleted successfully.")
Catch e As Exception
Console.WriteLine("The process failed: {0}.", e.ToString())
End Try
这篇关于如何在vb.net 2008中Winodws代理的右键单击事件上创建弹出菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文