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

How do I set an Icon property

Hi,

I have an file "painting.ico".
I use an class which has an "Icon" property.
How can I set this property.

I tried
- Build Action: embedded resource
But it crashed during the assignment
- class.Icon = new Icon("painting.ico");

Anybody know the right way?

Thanks in advance
Thomas
Mar 20 '06 #1
2 2894
you can use this:
this.button1.Image = global::WindowsApplication1.Properties.Resources.a ;

where a is the image in the resource file.

thank you.

"Thomas Wegener" <t.*******@mum.de> wrote in message
news:Oi**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have an file "painting.ico".
I use an class which has an "Icon" property.
How can I set this property.

I tried
- Build Action: embedded resource
But it crashed during the assignment
- class.Icon = new Icon("painting.ico");

Anybody know the right way?

Thanks in advance
Thomas

Mar 21 '06 #2
Thanks it works.
Thomas

"Mohammad Shalabi" <ms******@microsoft.com> schrieb im Newsbeitrag
news:u2**************@tk2msftngp13.phx.gbl...
you can use this:
this.button1.Image = global::WindowsApplication1.Properties.Resources.a ;

where a is the image in the resource file.

thank you.

"Thomas Wegener" <t.*******@mum.de> wrote in message
news:Oi**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have an file "painting.ico".
I use an class which has an "Icon" property.
How can I set this property.

I tried
- Build Action: embedded resource
But it crashed during the assignment
- class.Icon = new Icon("painting.ico");

Anybody know the right way?

Thanks in advance
Thomas


Mar 21 '06 #3

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

Similar topics

4
by: Bernie Yaeger | last post by:
I now know how to gather the file type icons and I'm able to use them in a listview. But a listbox does not have a .smallimagelist or .largeimagelist member, so I don't know how to translate that...
10
by: Zeljko | last post by:
Hi, I have a form with a tray icon. However, when I minimize the form, it stays visible - not in the task bar (I have showintaskbar property set to false), but in a form of a rectangle sitting...
8
by: Adrian | last post by:
How do I put an icon on a form using code? Thank you.
5
by: Gidi | last post by:
Hi, I want to add icon to my form (on the left corner of the form, where the fom text is), but i can't use the property window. how can i do it through the code? my Icon path now is d:\temp....
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...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
2
by: Peter Stojkovic | last post by:
I have programmed a window with an icon. Now I want, that this window has NO Icon. But I can not remove the icon within VS.NET. I can only select an other ICON ! How can I remove the icon...
5
by: IcingDeath via DotNetMonster.com | last post by:
I am building this SQL Server database app in which i can store files. In order to display files I want to have the app show the associated icon for the extension of the file that is in the...
3
by: Nina | last post by:
Hi there, I assigned icon for a window's form using form's Icon property at design time. Now I want to change the icon. I tried to replace the old icon with the new icon using form's Icon...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.