473,545 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2479
Hi

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

end class

hth

Peter

"rodchar" <ro*****@discus sions.microsoft .com> wrote in message
news:B1******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .com> wrote in message
news:B1******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .com> wrote in message
news:B1******** *************** ***********@mic rosoft.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.Reflecti on.Assembly =
System.Reflecti on.Assembly.Get ExecutingAssemb ly()
Dim TheStream As System.IO.Strea m
'The image name must be fully qualified with the assembly name and its
extension, case sensitive
TheStream =
TheAssembly.Get ManifestResourc eStream("Window sApplication1.F ileName.bmp")
Button1.Image = New System.Drawing. Bitmap(TheStrea m)

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

"Dennis" <De****@discuss ions.microsoft. com> wrote in message
news:C3******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .com> wrote in message
news:B1******** *************** ***********@mic rosoft.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.Reflecti on.Assembly =
System.Reflecti on.Assembly.Get ExecutingAssemb ly()
Dim TheStream As System.IO.Strea m
'The image name must be fully qualified with the assembly name and its
extension, case sensitive
TheStream =
TheAssembly.Get ManifestResourc eStream("Window sApplication1.F ileName.bmp")
Button1.Image = New System.Drawing. Bitmap(TheStrea m)

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

"Dennis" <De****@discuss ions.microsoft. com> wrote in message
news:C3******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .com> wrote in message
news:B1******** *************** ***********@mic rosoft.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
10048
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
2490
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 toolbox. What could i be doing wrong?
2
4041
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 it still wont show. I am using vbnet for my controls but have also tried it w/ controls written in c# - doesnt work in either case. So what am i...
6
1500
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....
2
19834
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
1028
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 Toolbox. 2. How to create a .dll of exe of my customr control only ? thx,
2
2695
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 ? thanks a lot,
1
5035
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 element) Best Regards Taptu¶
5
1698
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 what group they belong to. Can drop-downs have such graphics as opposed to just text? TIA
0
7685
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
7941
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
7452
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
7784
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...
0
6014
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
5354
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
5071
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...
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
738
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.