473,387 Members | 1,798 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.

new icon for custom control

hey all,

i'm trying to add an image to my custom control so that it looks unique in
my toolbox. i saw in a webcast that all you had to do was add the image to
the project and change the Build Action property to Embedded Resource.

i did that, recompiled it. but when i delete the old item from the toolbox
and add the new dll it still shows the default icon.

does the image need to be a certain size or something, i'm at a loss.

thanks,
rodchar
Nov 21 '05 #1
6 2470
Hi

<ToolboxBitmap("your path to bitmap")> Public Class YourClass

end class

hth

Peter

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
hey all,

i'm trying to add an image to my custom control so that it looks unique in
my toolbox. i saw in a webcast that all you had to do was add the image to
the project and change the Build Action property to Embedded Resource.

i did that, recompiled it. but when i delete the old item from the toolbox
and add the new dll it still shows the default icon.

does the image need to be a certain size or something, i'm at a loss.

thanks,
rodchar

Nov 21 '05 #2
http://www.bobpowell.net/toolboxbitmap.htm

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
hey all,

i'm trying to add an image to my custom control so that it looks unique in
my toolbox. i saw in a webcast that all you had to do was add the image to
the project and change the Build Action property to Embedded Resource.

i did that, recompiled it. but when i delete the old item from the toolbox
and add the new dll it still shows the default icon.

does the image need to be a certain size or something, i'm at a loss.

thanks,
rodchar

Nov 21 '05 #3
Great. What's the syntax for an embedded bitmap or Icon?

"Peter Proost" wrote:
Hi

<ToolboxBitmap("your path to bitmap")> Public Class YourClass

end class

hth

Peter

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
hey all,

i'm trying to add an image to my custom control so that it looks unique in
my toolbox. i saw in a webcast that all you had to do was add the image to
the project and change the Build Action property to Embedded Resource.

i did that, recompiled it. but when i delete the old item from the toolbox
and add the new dll it still shows the default icon.

does the image need to be a certain size or something, i'm at a loss.

thanks,
rodchar


Nov 21 '05 #4
this gets an image out of the assembly

Dim TheAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
Dim TheStream As System.IO.Stream
'The image name must be fully qualified with the assembly name and its
extension, case sensitive
TheStream =
TheAssembly.GetManifestResourceStream("WindowsAppl ication1.FileName.bmp")
Button1.Image = New System.Drawing.Bitmap(TheStream)

I hth because I have't got time to test if it's usefull in toolboxbitmap
case

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
Great. What's the syntax for an embedded bitmap or Icon?

"Peter Proost" wrote:
Hi

<ToolboxBitmap("your path to bitmap")> Public Class YourClass

end class

hth

Peter

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
hey all,

i'm trying to add an image to my custom control so that it looks unique in my toolbox. i saw in a webcast that all you had to do was add the image to the project and change the Build Action property to Embedded Resource.

i did that, recompiled it. but when i delete the old item from the toolbox and add the new dll it still shows the default icon.

does the image need to be a certain size or something, i'm at a loss.

thanks,
rodchar


Nov 21 '05 #5
thanks everyone, this helped.

"rodchar" wrote:
hey all,

i'm trying to add an image to my custom control so that it looks unique in
my toolbox. i saw in a webcast that all you had to do was add the image to
the project and change the Build Action property to Embedded Resource.

i did that, recompiled it. but when i delete the old item from the toolbox
and add the new dll it still shows the default icon.

does the image need to be a certain size or something, i'm at a loss.

thanks,
rodchar

Nov 21 '05 #6
Thanks...I'll give it try.

"Peter Proost" wrote:
this gets an image out of the assembly

Dim TheAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
Dim TheStream As System.IO.Stream
'The image name must be fully qualified with the assembly name and its
extension, case sensitive
TheStream =
TheAssembly.GetManifestResourceStream("WindowsAppl ication1.FileName.bmp")
Button1.Image = New System.Drawing.Bitmap(TheStream)

I hth because I have't got time to test if it's usefull in toolboxbitmap
case

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
Great. What's the syntax for an embedded bitmap or Icon?

"Peter Proost" wrote:
Hi

<ToolboxBitmap("your path to bitmap")> Public Class YourClass

end class

hth

Peter

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
> hey all,
>
> i'm trying to add an image to my custom control so that it looks unique in > my toolbox. i saw in a webcast that all you had to do was add the image to > the project and change the Build Action property to Embedded Resource.
>
> i did that, recompiled it. but when i delete the old item from the toolbox > and add the new dll it still shows the default icon.
>
> does the image need to be a certain size or something, i'm at a loss.
>
> thanks,
> rodchar


Nov 21 '05 #7

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

Similar topics

1
by: kathy | last post by:
I try to add a custom control icon by setting the project property page->application icon. But seems no effect. how to do that?
2
by: Showjumper | last post by:
I want my custom control to have its own toolbox icon. I create the bmp file and it has the same name as the control class. I then set it to embedded resource but it still doesnt appear in the...
2
by: Showjumper | last post by:
I still cant get an icon to display for my custom server control in the toolbox. I create a bmp that is the same name as the class of the control. I set it to embedded resource and then build but...
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: 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
1
by: Maileen | last post by:
Hi, I've created a custom control and it is display on MyControl tab in Toolbox. but i would like to know how : 1. can i set a particular icon to my customer control to see it displayed in...
2
by: --== Alain ==-- | last post by:
Hi, How can i custom the icon (shown on ToolBox Palette) of my Custom Visual C++.NET control ? Moreover, if i want to place my custom control on a particular TAB, how can i do that ? ...
1
by: Taptu¶ | last post by:
How can I insert custom icon in my treeview tag ? I use custom drawing with my control but I can't use images in this field. I need to insert icon and next I must detect onClick event (on tag...
5
by: Mark B | last post by:
I'd like to have a field in a gridview (or standalone on a webpage) that not only drops down each salespersons name but also precedes their name with a blue, red, green or orange dot icon depicting...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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
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...
0
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,...
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...

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.