473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Get the Application Icon??

Hello all,

I am trying to write a simple app with no forms, but which uses a system
tray icon and a context menu. I want to set the icon for the NotifyIcon to
the icon which is set for the application in the My Project settings dialog.

How can i get this icon?

Thanks in advance.
- Arthur Dent.
Apr 4 '06 #1
3 6373
> I am trying to write a simple app with no forms, but which uses a system
tray icon and a context menu. I want to set the icon for the NotifyIcon to
the icon which is set for the application in the My Project settings dialog.


Assuming the name of the icon is xxx, try this

Dim s as string = Application.ProductName & ".xxx.ico"
Icon = New
Icon(Reflection.Assembly.GetExecutingAssembly.GetM anifestResourceStream(s))

Apr 4 '06 #2
Actually, i found i think an easier way, though maybe not the "proper" way?

I wound up doing

myNotifyIcon.Icon =
System.Drawing.Icon.ExtractAssociatedIcon(Applicat ion.GetExecutablePath())
"AMercer" <AM*****@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
I am trying to write a simple app with no forms, but which uses a system
tray icon and a context menu. I want to set the icon for the NotifyIcon
to
the icon which is set for the application in the My Project settings
dialog.


Assuming the name of the icon is xxx, try this

Dim s as string = Application.ProductName & ".xxx.ico"
Icon = New
Icon(Reflection.Assembly.GetExecutingAssembly.GetM anifestResourceStream(s))

Apr 4 '06 #3
> Actually, i found i think an easier way, though maybe not the "proper" way?

In my case, I have a few icons as embedded resources in my exe file, and I
can get at any one by name with the fragment in my previous post. In your
case, you want the icon associated with the app, so I think you are doing
exactly the right thing. Also, your code will work in any app without the
code needing to know the icon name, and that is a plus in my opinion.
Apr 4 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Jarman | last post by:
Apologies in advance for the long post - I wanted to be sure I included all the relevant details. The answer is probably very, very simple. I am doing something stupid here, but I don't know what...
3
by: Will Mathies | last post by:
I have changed the icon used for my C# windows form application. Now I am having problems. When my app has several windows open they get grouped on the taskbar. The icon that this group uses is...
3
by: Sam | last post by:
I've been googling for a couple of hours now and tried some different things, but I've been unable to get the icon for a distributed access application to do anything but display the default...
3
by: Wayne | last post by:
I currently have an app whose Icon I am setting. I want to set the icons in my forms at run time to that of the application icon. How do I retrieve the application Icon so that I can use it for my...
2
by: Elad Gutman | last post by:
Hi Everyone, I'm facing an annoying problem and any help will be most appreciated . .. . I have a main application form and its icon is functioning excellent: it appears both in the taskbar...
6
by: Paul | last post by:
In other development environments i've used the IDE had facilities to create custom icons for the application and files it created. It would be nice to have a custom icon for a created file, but...
3
by: QLD_AU | last post by:
Is their a way in a VB.Net application to set all sub form icons to the main form ? or even set all icons to the Application icon, without having to reference the icon as a filename ? With...
1
by: Dick | last post by:
I have a shared project that contains icons and bitmaps that are used throughout my suite of applications. I have to set Form.Icon, PictureBox.Image, etc. using code because the form designer...
1
by: Avnish | last post by:
Hi, I have created an form based application in c# having some GUI. I have also added localization support to it due to GUI changes for different customers.Now the issue I have the Application...
0
by: developer77 | last post by:
Hi, Im using VS2005 vb.net . If I set the application icon to a known good icon , with all reasonable embedded sizes (16x16, 32x32, 64x64. 128x128, 256x256) then its not showing correctly in win 7....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.