简体   繁体   English

VB.NET中的自定义托盘面板

[英]Custom tray panel in VB.NET

i need to create system tray "panel" like Windows Media Player. 我需要创建系统托盘“面板”,例如Windows Media Player。 (not icon only, but complette form with buttons, images, etc.) (不仅是图标,还包括带有按钮,图像等的表格形式)

Here is wmp screenshot: 这是wmp屏幕截图:

wmp

Is it possible in VB.NET & Win 10? 在VB.NET和Win 10中可以吗?

Thanks and sorry for my english.. :) 感谢和抱歉我的英语.. :)

You actually can do kind of a "tray panel", and it isn't quite difficult. 您实际上可以做一个“托盘面板”,这并不困难。 Just create a Form Object and set its FormBorderStyle property to None , which will allow you to create your custom border. 只需创建一个Form Object并将其FormBorderStyle属性设置为None ,这将允许您创建自定义边框。 Then, do the following: 然后,执行以下操作:

Public Class Form1
    Public Timer1 As New Timer
    Private Sub Form1_Load(sender as Object, e as Eventargs) Handles MyBase.Load
        Timer1.Interval = 1
    End Sub

     Private Sub Form1_MouseDown(sender as Object, e as MouseEventargs)
         Timer1.Start()
     End Sub

     Private Sub Form1_MouseUp(sender as Object, e as MouseEventargs)
         Timer1.Stop()
     End Sub

     Private Sub Timer1_Tick(sender as Object, e as Eventargs)
         Me.Location = New Point(Me.Cursor.Position.X - (Me.Cursor.Position.X - Me.Location.X), Me.Cursor.Position.Y - (Me.Cursor.Position.Y - Me.Location.Y))
     End Sub
End Class

Once you've done that (I'm not sure it will work directly, try a bit and it should), enjoy designing the GUI... ;-) 完成此操作后(我不确定它是否可以直接运行,请尝试一点并且应该这样做),然后开始设计GUI ... ;-)
Hope this helps and by the way, your english is better than you think! 希望这会有所帮助,顺便说一句,您的英语水平比您想象的要好!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM