Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Administrators
Posted (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 by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

Posted
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

Posted

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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...