473,750 Members | 2,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot get ToolboxBitmap to work

Hello,

I have developed a library of controls but for the life of me cannot get
ToolboxBitmapAt tribute to work -- my image simply will not display in the
toolbox of any project using my controls.

First, what I have:

Visual Studio 2005, .NET 2.0. An assembly name of "Jfx.Framew ork" and a
default namespace of "Jfx". All the controls work fine when dropped into
other projects as a reference. The images just do not display in any
toolboxes, even those on my own machine.

In my VS project I have a class named JfxButton under a folder structure of
<Project root>/Jfx/Controls:

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Drawing;
using System.Data;
using System.Windows. Forms;

namespace Jfx.Controls
{
[ToolboxItem(tru e)]
[ToolboxBitmapAt tribute(typeof( JfxButton))] // Other constructors don't
work either
public class JfxButton : System.Windows. Forms.Button
{
....
}
}

Inside this same folder, Jfx/Controls, I have an embedded resource named
JfxButton.bmp which is a 16x16 bitmap. JfxButton.cs and JfxButton.bmp are in
the same folder.

I know that the embedded resource is there because it appears in a call to
Assembly.GetMan ifestResourceNa mes() as "Jfx.Jfx.Contro ls.JfxButton.bm p".
After reading other posts on this topic and, although it doesn't make much
sense to me, I know why the double Jfx is at the beginning.

What I've tried:

All combinations of ToolboxBitmapAt tribute constructors *including* just
fully-referencing the path on my hard drive. Cleaning the solution,
rebuilding the solution, re-installing VS2005, even screwing around with
project properties and making the default namespace and assembly name the
same failed to work for me. I tried building the project on another
development machine. I've messed around with a whole variety
ToolboxBitmapAt tribute constructors including with and without the typeof,
with and without the string image name, combinations of paths, combinations
of paths and image names, etc.

I found many references to this excellent and promising article
http://www.bobpowell.net/toolboxbitmap.htm. Nevertheless, I couldn't get the
'resfinder' trick to work for me. I tried the gamut of approaches outlined
on that page as well but to no avail.

There are also several references to MSDN articles on this topic (and MSDN
itself) but that darn image simply won't display for me.

I assume I'm missing something somewhere...

Given my 'project structure' above, is there a way to get
ToolboxBitmapAt tribute to work or am I going to have to like the gear icon?
If it can work, I sure could use some enlightment on how?

Thank you very much in advance for the time.

Mar 7 '06 #1
1 5934
"Jeff" wrote:
Hello,

I have developed a library of controls but for the life of me cannot get
ToolboxBitmapAt tribute to work -- my image simply will not display in the
toolbox of any project using my controls.

First, what I have:

Visual Studio 2005, .NET 2.0. An assembly name of "Jfx.Framew ork" and a
default namespace of "Jfx". All the controls work fine when dropped into
other projects as a reference. The images just do not display in any
toolboxes, even those on my own machine.

In my VS project I have a class named JfxButton under a folder structure of
<Project root>/Jfx/Controls:

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Drawing;
using System.Data;
using System.Windows. Forms;

namespace Jfx.Controls
{
[ToolboxItem(tru e)]
[ToolboxBitmapAt tribute(typeof( JfxButton))] // Other constructors don't
work either
public class JfxButton : System.Windows. Forms.Button
{
...
}
}

Inside this same folder, Jfx/Controls, I have an embedded resource named
JfxButton.bmp which is a 16x16 bitmap. JfxButton.cs and JfxButton.bmp are in
the same folder.

I know that the embedded resource is there because it appears in a call to
Assembly.GetMan ifestResourceNa mes() as "Jfx.Jfx.Contro ls.JfxButton.bm p".
After reading other posts on this topic and, although it doesn't make much
sense to me, I know why the double Jfx is at the beginning.

What I've tried:

All combinations of ToolboxBitmapAt tribute constructors *including* just
fully-referencing the path on my hard drive. Cleaning the solution,
rebuilding the solution, re-installing VS2005, even screwing around with
project properties and making the default namespace and assembly name the
same failed to work for me. I tried building the project on another
development machine. I've messed around with a whole variety
ToolboxBitmapAt tribute constructors including with and without the typeof,
with and without the string image name, combinations of paths, combinations
of paths and image names, etc.

I found many references to this excellent and promising article
http://www.bobpowell.net/toolboxbitmap.htm. Nevertheless, I couldn't get the
'resfinder' trick to work for me. I tried the gamut of approaches outlined
on that page as well but to no avail.

There are also several references to MSDN articles on this topic (and MSDN
itself) but that darn image simply won't display for me.

I assume I'm missing something somewhere...

Given my 'project structure' above, is there a way to get
ToolboxBitmapAt tribute to work or am I going to have to like the gear icon?
If it can work, I sure could use some enlightment on how?

Thank you very much in advance for the time.


I am unsure this is useful information but I'm beginning to think I have a
messed up Visual Studio.NET 2005 installation or something is caches funny.
I tried just hardcoding the paths above as in

[ToolboxBitmapAt tribute(@"C:\Jf xButton.bmp")]

where C:\JfxButton.bm p is a 16 color 16 x 16 bitmap file and the default
gear icon still is the only one to display for this control. My bitmap icon
simply will not show in the toolbox.

Any suggestions?

Thank you for your time.

Mar 14 '06 #2

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

Similar topics

2
1975
by: jean-dot-paul-at-opelwilly-dot-com | last post by:
Hello, Can I use the ToolboxBitmap from the inherted Control to show up in my toolbox and if so how? Greetings Jean Paul
8
5478
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
10
4468
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After creating an instance, starting the database, creating a database, and entering the table definitions, all of which seems to work OK, I entered a tiny 8-row table and can do...
0
2895
by: Adam Dockter | last post by:
I want my custom controls to have customer bitmaps but I can't get them to work if I try to pull the icon from a resource file. I know that I can add the icon to the project as an embedded resource then put the attribute. That works fine. But I would really like to put the icon in a resource file MyControl.resx then use it as the icon. Has anyone ever gotten this to work. Or has anyone figured out how to compile .ico files as...
1
1385
by: Simon | last post by:
Hi How do I to change toolbox bitmap of my custom control using ToolboxBitmap in MC++ ? Thanks in advance
0
1169
by: nicolas.hilaire | last post by:
Hi all, i'm creating an User Control (that is working). I would like to see my own image for this control, in the toolbox. Then, i'm using ToolboxBitmap namespace testUserControl { public ref class testUserControlControl : public
10
4711
by: MyndPhlyp | last post by:
(Second posting attempt) I have been through tons of old postings, several web sites, books, and even tried consulting a psychic but nothing is yielding the majik answer. I'm using VB '05 Express on a Win2K system. The project has everything grouped under various directories. The Solution Explorer looks like... AProject
0
1246
by: John | last post by:
I've created a component in VS.NET 2003 and I'm having a hard time getting my bitmap to show up in the Designer Toolbox in Visual Studio. I have designed an .ico file and have included the attribute as shown: <ToolboxBitmap(GetType(SmoothProgressBar2), "SmoothProgressBar2.ico"), _ DefaultProperty("Value")_ Public Class SmoothProgressBar2 .... End Class
2
8759
by: Nathan Sokalski | last post by:
I am attempting to create icons for controls I have created using VB.NET by using the System.Drawing.ToolboxBitmap attribute. I have managed to do this in C# by specifying the path to the *.ico file, but I have been unable to get any of the overloads to work in VB.NET. I would like to store the *.ico files in a *.resx file so that users do not need anything other than the *.dll, but at the moment I am just trying to get any of the overloads...
0
9000
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9577
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9396
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
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
3
2225
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.