2017-08-01 97 views
4

我需要像Windows媒體播放器一樣創建系統托盤「面板」。 (不僅沒有圖標,但complette形式的按鈕,圖像等)VB.NET中的自定義托盤面板

這裏是WMP截圖:

wmp

是否有可能在VB.NET & 10場?

感謝和我的英語水平抱歉.. :)

+3

您的圖片無效,但我想您正在尋找[** DeskBand **](https://msdn.microsoft.com/en-us/library/windows/desktop/cc144099(v = vs.85)的.aspx#desk_bands)。可悲的是,在.NET中做並不容易,並且需要P/Invoke知識。 –

+0

謝謝!用這個名字('DeskBand')我找到了文檔。 :) – Martin

回答

-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 ... ;-)
希望這會有所幫助,順便說一下,你的英語比你想象的要好!

+2

嗯......我想提問者的意思就像嵌入整個任務欄上的東西,就像...看到這個圖片我在谷歌找到:https://images.techhive.com/images/idge/imported/文章/ ctw/2012/06/06/lenovo_battery_charging_popupnote-100378724-orig.jpg也許提問者正在尋求這樣的一個... – Sree

+0

可能的,但是,我只是覺得我的答案可能給了他一些幫助,我很抱歉它沒有! –

+0

沒問題,至少你試過了 – Sree