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

时间:2017-08-01 09:58:55

标签: vb.net system-tray deskband

我需要像Windows Media Player一样创建系统托盘“面板”。 (不仅仅是图标,而是带有按钮,图像等的complette表格)。

这是wmp屏幕截图:

wmp

是否可以在VB.NET&赢10?

谢谢,对不起我的英语.. :)

1 个答案:

答案 0 :(得分:-2)

你实际上可以做一种“托盘面板”,并不是很难。只需创建一个Form对象,并将其FormBorderStyle属性设置为None,即可创建自定义边框。然后,执行以下操作:

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

一旦你完成了(我不确定它会直接工作,尝试一下它应该),享受设计GUI ... ;-) 希望这有帮助,顺便说一句,你的英语比你想象的更好!