473,788 Members | 2,652 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 4722

"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
1674
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
9498
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
10173
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...
1
10110
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
9967
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
8993
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
6750
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
5399
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4070
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
2894
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.