Cara guna NotifyIcon

Langkah 1: dapatkan grafik ikon (dari ICONSPEDIA.COM – [tekan sini])


Langkah 2: Toolbox > Common Controls  > NotifyIcon

s1


Langkah 3:  buat tetapan pada Component “NotifyIcon”

s2


s2b


Name: try_ni
Icon: (PERHATIAN: dapatkan grafik icon yang anda muat turun tadi pada LANGKAH 1)


PERHATIAN: pastikan anda memasukkan grafik icon pada “Icon“. Ini kerana sekiranya grafik ikon tiada maka teknik ini tidak berfungsi.






Langkah 3:  Tulis aturcara


s3



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Public Class Form1
    Private Sub skrinKeluar(ByVal sender As System.Object, ByVal e As EventArgs) Handles Me.Load
    End Sub
    Private Sub skrinTutup(ByVal sender As System.Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing
        'batalkan penutupan skrin
        e.Cancel = True
 
        'sorok skrin ke TaskBar
        Me.WindowState = FormWindowState.Minimized
        'sorok aplikasi dari TaskBar
        Me.ShowInTaskbar = False
 
        'papar ikon di System Tray
        try_ni.Visible = True
        'papar tek ikon di System Tray
        try_ni.BalloonTipText = "Skrin telah disorok ke 'System Tray'. Harap Maklum."
        'tajuk
        try_ni.BalloonTipTitle = "Makluman Aplikasi"
        'masa keluar
        try_ni.ShowBalloonTip(10)
        'ikon belon info
        try_ni.BalloonTipIcon = ToolTipIcon.Info
    End Sub
 
    Private Sub tekanTry_ni(ByVal sender As System.Object, ByVal e As EventArgs) Handles try_ni.Click
        try_ni.Visible = False
        Me.WindowState = FormWindowState.Normal
    End Sub
End Class



Selesai!!!


Perkongsian:

[download id="155"]


Leave a Reply

Your email address will not be published. Required fields are marked *

*

Upload Files

You can include images or files in your comment by selecting them below. Once you select a file, it will be uploaded and a link to it added to your comment. You can upload as many images or files as you like and they will all be added to your comment.

Spam Protection by WP-SpamFree