473,606 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8150
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.co m

"Wayne" <ws*****@NoLand Spamstar.com> wrote in message
news:eQ******** ********@tk2msf tngp13.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.c om> wrote in
message news:#w******** ******@TK2MSFTN GP10.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.co m

"Wayne" <ws*****@NoLand Spamstar.com> wrote in message
news:eQ******** ********@tk2msf tngp13.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(For m1),"MY_ICON.IC O");
/* 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*****@NoLand Spamstar.com> wrote in message
news:eQ******** ********@tk2msf tngp13.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
6352
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 (so far as I understand it) the recipe in the eff-bot's splendid Introduction to Tkinter - see:...
5
2213
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 executable, and not the icon that has been specified by form. another usenet post here (watch for URL wrap) ...
3
3413
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 microsoft access icon. I've included the icon with the distribution and specified it as the application in the icon in the wizard, but no love from Access. Any help with this will me much appreciated. Thanks, Sam90
6
1502
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 it is more important to give the application its own icon. I've looked in over ten books in VB.net programming and none of them cover this issue. How do I do it or where do I find the info? Thanks,
2
2639
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 in the Taskbar status area. The NotifyIcon component appears to be a logical candidate and worked...
3
21426
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
1
5238
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 to the deployment application in Visual Studio.NET. First question: I need to add some data files into the deployment application, but I do not want them uninstalled when the program is uninstalled through ADD/REMOVE programs. These are XML,...
1
10127
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 authentication or the windows based authentication mode. If the administrator sets the application authentication mode to windows based, then the application has to verify the windows logged in username and password and then allow the user to use...
4
6540
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 right-clicked the project-> Add Existing Item-> added the new ico file. I set the build action to Embedded...
0
7942
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8433
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8084
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8300
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6761
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5963
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5461
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1550
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1287
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.