473,401 Members | 2,127 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,401 software developers and data experts.

Component Ion

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 automatically by VS2005 to the component.
It seems like a flower.

How I can assign my own icon to the component?.

Thanks in advance.

--
Tomas
Mar 4 '07 #1
8 1677
Hi Tomas,

Based on my understanding, you want to assign a customized ICON to your own
component, so that it will be displayed in the ToolBox and designer
component tray. If I have misunderstood you, please feel free to tell me,
thanks.

This is mainly a .Net Winform design-time feature. You may leverage the
ToolboxBitmapAttribute to get this done. Please refer to "Attributes"
section in the link below:
"Building Windows Forms Controls and Components with Rich Design-Time
Features"
http://msdn.microsoft.com/msdnmag/is...rols/default.a
spx

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 5 '07 #2
I have this error:

Error C2337 'attribute name' : attribute not found.

This attribute name is not avalaible on this version of Visual Studio.

Where I can find the list of attributes available?

--
Tomas
Mar 5 '07 #3
Hi Tomas,

Thanks for your feedback.

Can you provide a little sample project to help me reproduce this error?

I have created a CLR C++ Winform Control Library project and apply the
attribute like below:

[ToolboxBitmap("c:\\ico1.ico")]
public ref class CLIControlControl : public
System::Windows::Forms::UserControl

This project compiles without any problem.

In another C++ CLR Winform project, I added the CLIControlControl in the
ToolBox manually, the icon will display well.

Note: the size of the bitmap that you used should be 16 by 16.

Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 6 '07 #4

"Tomas" <To***@newsgroup.nospamwrote in message
news:EA**********************************@microsof t.com...
>I have this error:

Error C2337 'attribute name' : attribute not found.
You might need to use the full name,
::System::Drawing::ToolboxBitmapAttribute and/or add a reference to
System.Drawing.dll
This attribute name is not avalaible on this version of Visual Studio.

Where I can find the list of attributes available?

--
Tomas

Mar 6 '07 #5
You might need to use the full name,
::System::Drawing::ToolboxBitmapAttribute and/or add a reference to
System.Drawing.dll
Yes, you are right, I have made this:

[System::Drawing::ToolboxBitmapAttribute("C:\\app.i co") ]

My Icon is 16x16 size, but not all colors are displayed in the toolbar, but
it does not matter.

Thanks.
Mar 6 '07 #6
Hi Tomas,

Thanks for your feedback.

Oh, do you use "Windows Control Library" project type to create your
component? If you are using "Windows Control Library" project type, there
will be an already "using namespace System::Drawing;" in the file, so the
full path of "System::Drawing::ToolboxBitmapAttribute" is need. So I
suspect you are creating "Windows Class Library" project type, which will
not add "using namespace System::Drawing".

Anyway, glad to see you have figured it out. Regarding the further color
not displayed issue, I assume VS IDE can only support 16 colors in the ICO
file, so some other colors may not be displayed correct on it.

If you still need any help or have any concern, please feel free to tell
me, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 7 '07 #7
Oh, do you use "Windows Control Library" project type to create your
component? If you are using "Windows Control Library" project type, there
will be an already "using namespace System::Drawing;" in the file, so the
full path of "System::Drawing::ToolboxBitmapAttribute" is need. So I
suspect you are creating "Windows Class Library" project type, which will
not add "using namespace System::Drawing".
I have made this:

[ System::Drawing::ToolboxBitmapAttribute("C:\\app.i co") ]
public ref class WindowState : public System::ComponentModel::Component
{
....
};

It is a class that save/restore the window size and position for every form
in the application.

Thanks for your help.
Mar 7 '07 #8
Hi Tomas,

Thanks for your clarify.

Yes, class library component project does not using the namespace of
System::Drawing by default, so you may have to add it yourself or use the
full namespace to specify the ToolboxBitmapAttribute.

If you need further help or any concern, please feel free to post, thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 8 '07 #9

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

Similar topics

12
by: Chien Lau | last post by:
I had a situation occur today that's happened a number of times before and I'd like to get your take on it: Imagine... You're developing a WinForms app for a client that includes the use charts....
4
by: orangepic333 | last post by:
Could someone tell me what's the difference between the two? Is it that a class is used within an OO language while a component can be exported between OO languages? Are there other...
2
by: Edward Diener | last post by:
How does one specify in a component that a property is a pointer to another component ? How is this different from a property that is actually an embedded component ? Finally how is one notified in...
0
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
1
by: Rob Griffiths | last post by:
Can anyone explain to me the difference between an element type and a component type? In the java literature, arrays are said to have component types, whereas collections from the Collections...
122
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
7
by: Joe | last post by:
Is it possible to have a component which is global to the entire application? I need to have a single component act sort of like a server which components in any of the forms can access. For...
11
by: BillGatesFan | last post by:
I have a web service which calls a .NET queued serviced component in COM+. I turned statistics on for the component. I call the component 10 times, 10 objects get created but they do not go away....
0
by: bharathreddy | last post by:
In .Net COM+ components are referred to as serviced components, Namespace: System.EnterpriseServices; Advantage of Serviced Components: object pooling, database connection pooling,
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: 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
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,...
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
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
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
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...

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.