473,547 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting Application Icon using code

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.Imag e, etc. using code because the form
designer can't see the icons and bitmaps unless they're in the local project.
This is only slightly inconvenient compared to the benefits from managing the
icons and bitmaps centrally.

However, I can't see how to do set the Application Icon using code. It seems
the only way to set Application Icon is to have the icon in the local project
and to set it via the project's property pages. Is there another way?
Sep 25 '06 #1
1 2705
Hi,

To set the icons for forms, we can use Form.Icon = new
Icon("filename. ico"); to achieve this. However, the application icon is set
at link time. When building, the linker gets everything including the
application icon file and generates the target assembly. This job cannot be
done at runtime. So, we cannot set the application icon at runtime using
code.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Sep 26 '06 #2

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

Similar topics

11
15743
by: Grant Edwards | last post by:
I'm trying in vain to set the icon for the executable generated by py2exe. According to various sources there are two answers: 1) Do it on the command line: python setup.py py2exe --icon foo.ico That generates a usage error: error: --icon not recognized
4
6351
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 it is. I'm writing an application with a Tkinter GUI (Python 2.4, Tcl/Tk 8.4.) and I want to put a custom icon on the main window. I've followed...
2
2636
by: Randall Powell | last post by:
I am in the process of developing a Windows Service which will: (1) monitor multiple network shares; (2) marshal text file transfers into an SQL Server 2000 instance; and (3) provide messaging services via email and a customized event log viewer. An additional goal is to have the service provide a visual status indicator via an icon to be located...
3
21404
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 Thanks Jason
6
2372
by: David | last post by:
I would like to change our web site to show the products using a catalog style of presentation. MS have a free template called "ecommercesdk". Though I don't need the cart side, the database format looks good. I tried to run the application from VB.NET 2003 but could not load the program (Kept asking for URL to web based application and I...
1
2280
by: hansolox1 | last post by:
The following program simply sets the icon of a form called form1. When I get the name of the embedded icon using GetManifestResourceNames(), I store the name in a string variable called s. The value of s is "test2.icon1.ico". This program will compile and run just fine from visual studio .net 2003 using .net 1.1 and also will compile and...
4
6534
by: randy1200 | last post by:
I have a Windows application that previously had the company logo "MyCompany.ico" added to the upper left-most corner. The company has since issued a new version of "MyCompany.ico" that looks completely different. I overwrote the old ico file with the new ico file and re-ran the program. I still see the old logo at run-time. I...
0
508
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 can't see the icons and bitmaps unless they're in the local project. This is only slightly inconvenient compared to the benefits from managing the...
1
48046
Plater
by: Plater | last post by:
C# (and possibly VB.NET) in VS2005 can be a bit tricky. Here's my little rundown: Add an icon file to your project (new or exisiting, whichever) Open the icon file is VS and edit as desired. (Note: On the left hand side is a small preview of the icon, extra sizes can be added to the SAME icon file there as well as cycling through...
0
7507
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7698
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5361
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.