473,774 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get <ToolboxBitma p> to work!

(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
--My Project
--classes
----AClass.vb
--forms
----AForm.vb
--Resources
----AClass.bmp

If you haven't guessed it already I am trying to get the AClass.bmp to be
the Toolbox icon for the AClass class rather than the default gear. The
class's abbreviated version looks like...

Namespace AProject
<ToolboxBitmap( GetType(AProjec t.AClass), "AClass")_
Public Class AClass
Inherits System.Windows. Forms.TextBox
' Properties, Methods, and Events snipped
End Class
End Namespace

The bitmap is 15x15 16-color. (Documentation says 16x16, expert sites say
16x15 or 15x16 but don't bother to mention if that is height-by-width or
width-by-height so I took the lowest common denominator.) The Build Action
is set to Embedded Resource.

The file is listed in the Project's Resources and the Persistence is set to
Linked at compile time.

I've tried several permutations on the string value at the second parameter
position including...

AProject.Resour ces.AClass (w/ and w/o ".bmp")
Resources.AClas s (w/ and w/o ".bmp")
AProject.AClass (w/ and w/o ".bmp")
AClass (w/ and w/o ".bmp")

I've tried relocating the BMP to the root directory of the Project and/or
the classes directory.

I've tried a fully-qualified path and file name.

I've tried everything except electroshock therapy and I'm seriously
considering even that option today.

What the heck am I doing wrong (other than wasting time on this very trivial
matter)?
Jul 21 '06
10 4718

"Dennis" <De****@discuss ions.microsoft. comwrote in message
news:39******** *************** ***********@mic rosoft.com...
This is probably not your situation but I have had trouble getting
embedded
resources to work when I add a project, say project "A", to my current
solution then try to add an embedded resource to Project "A" when the
solution for the first project is open. I have to close the open project
then open Project "A" separately, add the embedded resource them recompile
Project "A". When I re-open my original solution, I then have the
resource
in Project "A" available.
Yeah, that's an ongoing "theme" with this IDE. The easiest way I've found
around that is to go ahead and add in all the various projects of interest,
make sure the main project is the Startup Project, do a Build =Clean
Solution, and a Build =Rebuild Solution (the latter of which could
probably just as well be a Build =Build Solution).

The Clean removes any existing embeddable components from the Toolbox. The
Rebuild/Build puts them right back plus whatever was missing due to new
project inclusions. Once things have been rebuilt the objects are readily
available.

It is very annoying, to say the least. I am used to VB6 where I could toss
together a UC and immediately have it available for inclusion. With this IDE
a Build has to be done before the object becomes available even though you
are not generating a DLL or OCX.

Another annoyance in getting homegrown objects to embed is that the object's
qualifiers (namespace paths) tend to get messed up in the *.Designer.VB
files. Haven't found a solution to that one yet. I end up having to manually
fix them.

That is by far not an all-inclusive list however. Since I started down the
VB.Net path I have discovered /*many*/ 4-lettered words even God has never
heard before.
Jul 26 '06 #11

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

Similar topics

0
1934
by: Sundown | last post by:
I am trying to create a custom button control for the web that, when clicked, disables and changes the text of itself and a bunch of other controls (in the collection). My goal is to end up with a button that prevents the user from submitting a form back multiple times and also prevents them from submitting the form and then clicking something else before the postback can finish processing. What I have is a working button that disables...
0
2897
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...
4
2150
by: steve bull | last post by:
I have created a UserControl and added it to my toolbox. It appears in the toolbox with the icon I created for it. The problem is that when I drag the control onto a form no code is generated. If I manually add the code for creating the control to the form everything works fine. I have created other controls w/o problems and cannot see anything I am doing different in this case. Does anyone have any idea what I could be doing wrong? ...
1
5936
by: Jeff | last post by:
Hello, I have developed a library of controls but for the life of me cannot get ToolboxBitmapAttribute 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.Framework" and a default namespace of "Jfx". All the controls work fine when dropped into
4
1673
by: OpticTygre | last post by:
I have a control I built, for which I would like to add a tool bar icon, but for some reason, it's not working correctly. There is no default namespace (I removed it from the properies page of the project), and the icon file has been included in the project and it's build option is set to "Embedded Resource." The only thing I can think of that could be messing it up (but I'm not sure) is that the class file and the icon file are in...
0
256
by: MyndPhlyp | last post by:
I can't believe this is so difficult. 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 --My Project
2
1702
by: rotsj | last post by:
Hello, I would like to make my own dropdownlist and add a collection as a generic List. When I enter items @ designtime, @ runtime they are gone. Can anyone tell me please what the problem is? This is my code:
2
8760
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
9621
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
9454
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
10267
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...
1
10040
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
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...
1
7463
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2852
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.