473,499 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

icon for UserControl

Hi all,

I'd tried to follow the instructions from msdn for adding icon image for a
control. I've checked the name of bmp file is same as the control name
and turn the bmp file to "Embedded Resource". After building the project
again, the icon of my user control is the same as default. I'm not sure it's
related to my VB.Net version is an express edition or not? Anyone know
what's wrong ?
I did this :
Created a 16 x 16 pixd (256 colors)
gave it the name of the class (MonLabel->
"MonLabel.bmp"). Then added the bitmap to the project and set its build
action to embedded resource.
Extended my code like this:

Imports System.ComponentModel
<ToolboxBitmap(GetType(MonLabel), "MonLabel.bmp")_
Public Class MonLabel
Inherits Windows.Forms.Label
Thanks
pascal
Oct 28 '08 #1
4 4176
Hi Pascal,

You have to enter the fully-qualified name of the resource file
(MonLabel.bmp) which includes your project namespace (consult your Project
Properties for the namespace). E.g. it would then be:

<ToolboxBitmap(GetType(MonLabel), "ProjectNamespace.MonLabel.bmp")_

--
Stanimir Stoyanov
http://stoyanoff.info

"Pascal" <sc**@wndoo.frwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi all,

I'd tried to follow the instructions from msdn for adding icon image for a
control. I've checked the name of bmp file is same as the control name
and turn the bmp file to "Embedded Resource". After building the project
again, the icon of my user control is the same as default. I'm not sure
it's
related to my VB.Net version is an express edition or not? Anyone know
what's wrong ?
I did this :
Created a 16 x 16 pixd (256 colors)
gave it the name of the class (MonLabel->
"MonLabel.bmp"). Then added the bitmap to the project and set its build
action to embedded resource.
Extended my code like this:

Imports System.ComponentModel
<ToolboxBitmap(GetType(MonLabel), "MonLabel.bmp")_
Public Class MonLabel
Inherits Windows.Forms.Label
Thanks
pascal
Oct 29 '08 #2
"Pascal" <sc**@wndoo.frwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi all,

I did this :
Created a 16 x 16 pixd (256 colors)
No help with the dotNet stuff, but thought I'd mention.... in VB6, anyway,
that 16x16 (it says "16x15, scaled if necessary" in VB6) is the "toolbox"
size of your bitmap... which means you can work with 64x64 if you want and
it'll be scaled down automatically, so it shows in the toolbox...

I've never been able to create anything in 16x16 that looked decent. 32x32's
about as low as I can go. No "256 color" restrictions, either.
Oct 30 '08 #3
Bonjour
Arrgh ! Impossible to modify the default icon it's always the teethed wheel!
my bmp is now 64x64 and called MonLabel.bmp

<ToolboxBitmap(GetType(MonLabel), "MonLabel.MonLabel.bmp")_

Public Class MonLabel
--













http://www.scalpa.info
http://scalpa98.blogspot.com/
"Stanimir Stoyanov" <st******@REMOVETHIS.live.coma écrit dans le message
de news: FD**********************************@microsoft.com...
Hi Pascal,

You have to enter the fully-qualified name of the resource file
(MonLabel.bmp) which includes your project namespace (consult your Project
Properties for the namespace). E.g. it would then be:

<ToolboxBitmap(GetType(MonLabel), "ProjectNamespace.MonLabel.bmp")_

--
Stanimir Stoyanov
http://stoyanoff.info

"Pascal" <sc**@wndoo.frwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Hi all,

I'd tried to follow the instructions from msdn for adding icon image for
a control. I've checked the name of bmp file is same as the control name
and turn the bmp file to "Embedded Resource". After building the project
again, the icon of my user control is the same as default. I'm not sure
it's
related to my VB.Net version is an express edition or not? Anyone know
what's wrong ?
I did this :
Created a 16 x 16 pixd (256 colors)
gave it the name of the class (MonLabel->
"MonLabel.bmp"). Then added the bitmap to the project and set its build
action to embedded resource.
Extended my code like this:

Imports System.ComponentModel
<ToolboxBitmap(GetType(MonLabel), "MonLabel.bmp")_
Public Class MonLabel
Inherits Windows.Forms.Label
Thanks
pascal

Oct 30 '08 #4
Hi again

I follow all the step mentionned here without success. I use Vb express
edition? Is it the reason why?
http://support.microsoft.com/default...;EN-US;Q311315
Oct 30 '08 #5

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

Similar topics

2
4585
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
1
1323
by: VJ | last post by:
I am developing a usercontrol... how do I set a Icon for it..? the property in Project -> Proeprties in greyed out.. VJ
7
1050
by: OpticTygre | last post by:
When you create a new component, compile it, and add it to the toolbox, it comes with that boring gearbox icon next to it. How can you change the icon associated with a new component you create?
41
4236
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
1
1526
by: Sagaert Johan | last post by:
Hi How can i add an icon to my customcontrol so it appears in the toolbox ? How is this done in VS2005 ?
1
1110
by: Aristotelis Pitaridis | last post by:
Does anyone knows how to set an icon for a control that I created? Aristotelis
2
2689
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 ? ...
8
1680
by: =?Utf-8?B?VG9tYXM=?= | last post by:
Hello, I have made a component to use in a form. I have add the component to the tools bar in Visual Studio 2005 to use in more than one project. I want to change the Icon asigned...
0
876
by: Pascal | last post by:
Very strange!!! When i use the dll in another solution, it works : in the toolbox, it's the good icon !
0
7134
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
7180
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,...
1
6901
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
5479
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
4605
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...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
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...

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.