By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

icon for UserControl

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.