4

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

这是wmp截图:

wmp

在 VB.NET 和 Win 10 中是否可行?

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

4

1 回答 1

-2

你实际上可以做一种“托盘面板”,这并不难。只需创建一个FormObject 并将其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... ;-)
希望这会有所帮助,顺便说一下,你的英语比你想象的要好!

于 2017-08-06T11:16:26.213 回答