TBD.my

Full Version: tolong..code minimize ke tray??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
siapa ada code vb utk minimize ke tray??
(01-01-2011, 08:10 PM)reznet Wrote: [ -> ]siapa ada code vb utk minimize ke tray??

aku dah terdelete vb2 aku. try tanya Stynx atau Dmnyx. atau pakcik gugirl.
Aku ada post soskod kt section ni cuba cek program-program yg guna tray minimize tu. Takpun try Google sebab aku belajar daripada situ gak. Kalau tak dapek gak PM aku.
senang jorr , aku bru try buat haritue ...

aku pakai vb 2008
1st , ko add toolbar 'notify icon' dekat ko pnya form
2nd , klik notify icon , pastu pergi dekat properties dia , pastu browse icon yang ko nak
3 rd double klik notify icon tu , pastu add code 'me.show'
4 rd buat satu button nama 'close' , pastu add code 'me.close'

SIAP !
Cuba yg ni ~

Quote: Me.WindowState = FormWindowState.Minimized
Me.Visible = False
NotifyIcon1.Visible = True
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        NotifyIcon1.Visible = False
    End Sub

    Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
        Try
            Me.Show()
            Me.WindowState = FormWindowState.Normal
            NotifyIcon1.Visible = False

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        Try
            If Me.WindowState = FormWindowState.Minimized Then
                Me.WindowState = FormWindowState.Minimized
                NotifyIcon1.Visible = True
                Me.Hide()
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
terime kasih..atas reply
aku da try semua cr dlm thread ni. tp ada bug la. knp bila kat tray dia ada 2 ikon yg sama yg on. adeh....