cattivik66 Posted April 4, 2004 Posted April 4, 2004 I think that it's possible to make that... but how? I've included the reference to System.Windows.Forms but I cannot add the object NotifyIcon :( Some1 has some ideas? If this seems u a bad question.. sorry I program VB.NET since yesterday :p Quote
Administrators PlausiblyDamp Posted April 4, 2004 Administrators Posted April 4, 2004 (edited) Add a reference to both System.windows.Forms and System.Drawing. Just tried with a new project - only entered the following code and it worked. Dim ni As New System.Windows.Forms.NotifyIcon ni.Icon = New System.Drawing.Icon("..\Face01.ico") ni.Visible = True Console.ReadLine() Just change Face01.ico to whatever your icon is. Edited April 4, 2004 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
cattivik66 Posted April 4, 2004 Author Posted April 4, 2004 Hem I've now done it!!! :D Added references to: System.Windows.Forms System.Drawing CODE: Imports System.Drawing Module Module1 Dim NotifyIcon As System.Windows.Forms.NotifyIcon Private mSmileIcon As New System.Drawing.Icon("D:\face02.ico") Public Sub Main() NotifyIcon = New System.Windows.Forms.NotifyIcon NotifyIcon.Icon = mSmileIcon NotifyIcon.Text = "Right Click for the menu" NotifyIcon.Visible = True 'OTHER CODE NotifyIcon.Visible = False End Sub End Module Now I've to make that if some1 click on the icon the console shows or hide.. ehehe :p Quote
cattivik66 Posted April 4, 2004 Author Posted April 4, 2004 Add a reference to both System.windows.Forms and System.Drawing. Just tried with a new project - only entered the following code and it worked. Dim ni As New System.Windows.Forms.NotifyIcon ni.Icon = New System.Drawing.Icon("..\Face01.ico") ni.Visible = True Console.ReadLine() Just change Foce01.ico to whatever your icon is. wow thx :) done it just 1 min ago :p Quote
cattivik66 Posted April 4, 2004 Author Posted April 4, 2004 how to hide a console.. but it uses Windows API :( Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Integer, ByVal nCmdShow As Boolean) As Integer Public Declare Function GetConsoleWindow Lib "kernel32" () As Integer and on the module.. Dim int As Integer = GetConsoleWindow ShowWindow(int, False) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.