473,413 Members | 1,795 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,413 software developers and data experts.

How to retreive the application Icon

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 forms? once retrieved can I
just set the form Icon? or do I need to do something special?

Thanks
Wayne
Nov 16 '05 #1
3 8136
Wayne,

I would create a class with a static member which would return the icon
when called. Then, all of your forms would access this static method to set
the icon that it should have. Where you get this icon is up to you (you can
get it from a resource file, etc, etc).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Wayne" <ws*****@NoLandSpamstar.com> wrote in message
news:eQ****************@tk2msftngp13.phx.gbl...
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 forms? once retrieved can I
just set the form Icon? or do I need to do something special?

Thanks
Wayne

Nov 16 '05 #2
I don't really want to do it that way, I currently have some plugins that
may or may not display forms when they are shown. I'd like to be able to
have the plugin query information from the main assembly to get the Icon.
Not to mentioned I'd like to figure out how to do it.

Thanks
Wayne

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:#w**************@TK2MSFTNGP10.phx.gbl...
Wayne,

I would create a class with a static member which would return the icon when called. Then, all of your forms would access this static method to set the icon that it should have. Where you get this icon is up to you (you can get it from a resource file, etc, etc).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Wayne" <ws*****@NoLandSpamstar.com> wrote in message
news:eQ****************@tk2msftngp13.phx.gbl...
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 forms? once retrieved can I
just set the form Icon? or do I need to do something special?

Thanks
Wayne


Nov 16 '05 #3
Wayne

If you are referring to the App.ico resource that the wizard supplies, you
can compile the App icon as an embedded resource - then create a static
method as Nicholas suggested to return a reference to the Icon object. In
Solution Explorer, right click on the icon resource, select Properties, and
change the Build Action to Embedded Resource. Then to get the icon resource
into an Icon object, try something like this in the main method of your app:

static void Main()
{
myIcon = new Icon(typeof(Form1),"MY_ICON.ICO");
/* do something with myIcon here... */
Application.Run(new Form1());
}

You can easily add icons and include them as resources in the assembly using
the IDE Add|Existing Item, browsing to the file that contains the .ico
resource, and then changing the Build Action to Embedded Resource.

Note - the icon resource name is case sensitive in the Icon constructor...

regards
roy fine

"Wayne" <ws*****@NoLandSpamstar.com> wrote in message
news:eQ****************@tk2msftngp13.phx.gbl...
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 forms? once retrieved can I
just set the form Icon? or do I need to do something special?

Thanks
Wayne

Nov 16 '05 #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...
5
by: Matthew Fitzpatrick | last post by:
when multiple similar forms are opened up, windows xp can group them into an application group button on the start bar. Unfortunately, this application group uses the icon of the application's...
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...
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...
2
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...
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: Supercox | last post by:
I am on a team programming a VB.NET application (called "Alternate Benefit Calculator" or ABC for short) and I have been preparing our program for deployment. I have several questions pertaining...
1
by: Sudhakara.T.P. | last post by:
Hi, I have an application in VB.NET windows application, wherein the administrator has the option to change the authentication mode ie., whether the application should work as a normal database...
4
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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,...
0
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...
0
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...

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.