473,386 Members | 1,668 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,386 software developers and data experts.

Icons in controls

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 subfolders in the project
itself. Other than that, when I compile, and add the DLL to the Toolbox, it
comes up with the standard gear control icon instead of the icon I chose.

Any ideas?

Code is this:

Namespace OS.WinForms.Controls

<ToolboxBitmap(GetType(OS.WinForms.Controls.Progre ssBar),
"ProgressBar.ico")> _
Public Class ProgressBar
Inherits System.Windows.Forms.Control

...yadda yadda yadda...

End Class

End Namespace

Thanks for any help.
-Jason
Jun 28 '06 #1
4 1647
Try removing the .ico from the icon name.

OpticTygre wrote:
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 subfolders in the project
itself. Other than that, when I compile, and add the DLL to the Toolbox, it
comes up with the standard gear control icon instead of the icon I chose.

Any ideas?

Code is this:

Namespace OS.WinForms.Controls

<ToolboxBitmap(GetType(OS.WinForms.Controls.Progre ssBar),
"ProgressBar.ico")> _
Public Class ProgressBar
Inherits System.Windows.Forms.Control

...yadda yadda yadda...

End Class

End Namespace

Thanks for any help.
-Jason


Jun 29 '06 #2
Removing the .ico from the name doesn't work. I've also tried adding it
directly as a resource in the project properties pages, which doesn't work
either. Perhaps there's an issue with the icon itself?

-Jason

"Ahmed" <ah*******@gmail.com> wrote in message
news:11**********************@d56g2000cwd.googlegr oups.com...
Try removing the .ico from the icon name.

OpticTygre wrote:
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 subfolders in the project
itself. Other than that, when I compile, and add the DLL to the Toolbox,
it
comes up with the standard gear control icon instead of the icon I chose.

Any ideas?

Code is this:

Namespace OS.WinForms.Controls

<ToolboxBitmap(GetType(OS.WinForms.Controls.Progre ssBar),
"ProgressBar.ico")> _
Public Class ProgressBar
Inherits System.Windows.Forms.Control

...yadda yadda yadda...

End Class

End Namespace

Thanks for any help.
-Jason

Jun 29 '06 #3
Maybe because it's an icon. Try a bitmap.

OpticTygre wrote:
Removing the .ico from the name doesn't work. I've also tried adding it
directly as a resource in the project properties pages, which doesn't work
either. Perhaps there's an issue with the icon itself?

-Jason

"Ahmed" <ah*******@gmail.com> wrote in message
news:11**********************@d56g2000cwd.googlegr oups.com...
Try removing the .ico from the icon name.

OpticTygre wrote:
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 subfolders in the project
itself. Other than that, when I compile, and add the DLL to the Toolbox,
it
comes up with the standard gear control icon instead of the icon I chose.

Any ideas?

Code is this:

Namespace OS.WinForms.Controls

<ToolboxBitmap(GetType(OS.WinForms.Controls.Progre ssBar),
"ProgressBar.ico")> _
Public Class ProgressBar
Inherits System.Windows.Forms.Control

...yadda yadda yadda...

End Class

End Namespace

Thanks for any help.
-Jason


Jun 29 '06 #4
Finally figured it out.

For all those who are interested, the icon file MUST have a filename with a
prefix of the Namespace where the class is located at.

For example, the full path to my class is
"OS.WinForms.Controls.ProgressBar", so the filename of the Icon had to be
"OS.WinForms.Controls.ProgressBar.ico"

Once I renamed the file, I could reference the icon correctly using:

Namespace OS.WinForms.Controls

<ToolboxBitmap(GetType(ProgressBar), "ProgressBar")> _
Public Class ProgressBar
Inherits System.Windows.Forms.Control

.........

End Class

End Namespace

Basically, the icon file has to have a filename of the full path of the
class + ".ico"

-Jason

"Ahmed" <ah*******@gmail.com> wrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Maybe because it's an icon. Try a bitmap.

OpticTygre wrote:
Removing the .ico from the name doesn't work. I've also tried adding it
directly as a resource in the project properties pages, which doesn't
work
either. Perhaps there's an issue with the icon itself?

-Jason

"Ahmed" <ah*******@gmail.com> wrote in message
news:11**********************@d56g2000cwd.googlegr oups.com...
> Try removing the .ico from the icon name.
>
> OpticTygre wrote:
>> 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 subfolders in the
>> project
>> itself. Other than that, when I compile, and add the DLL to the
>> Toolbox,
>> it
>> comes up with the standard gear control icon instead of the icon I
>> chose.
>>
>> Any ideas?
>>
>> Code is this:
>>
>> Namespace OS.WinForms.Controls
>>
>> <ToolboxBitmap(GetType(OS.WinForms.Controls.Progre ssBar),
>> "ProgressBar.ico")> _
>> Public Class ProgressBar
>> Inherits System.Windows.Forms.Control
>>
>> ...yadda yadda yadda...
>>
>> End Class
>>
>> End Namespace
>>
>> Thanks for any help.
>> -Jason
>

Jun 30 '06 #5

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

Similar topics

24
by: Crom | last post by:
Ok. I want to settle this once and for all. After looking at the source for various, rather sizeable (but not all were so big) web sites that use icons that show up in the addressbar beside the...
4
by: What-a-Tool | last post by:
Is possible to use the windows image list for icon display in my treeview control? Would appreciate it you could point me towards a code sample or Key phrase to use in a google search. Thanks...
3
by: Tam | last post by:
im at my wits end. where can i get icons for an application im building. i need the usual ones, align, font size etc but i simply cannot find the icons. im probably being dumb but ive tried...
2
by: Jigar Mehta | last post by:
Hye, I am Jigar Mehta, I want to ask how can we put our own 48 X 48 - 32 bit icons in the interface like near password field, I want to put Password Icon. The icons are created with Alpha support...
0
by: Dragos Dutu | last post by:
Hello people! I have a quite complicated question. While creating a ToolBar in code, it is possible to pass the standard icons located in COMMCTRL to the image list of the ToolBar. I'm talking...
2
by: OpticTygre | last post by:
Hi folks. I'm currently in the midst of building an explorer - like viewer for a bigger project I'm going to be working on soon. When building the class for my Treeview and Listview controls, I'm...
7
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form...
0
by: gene kelley | last post by:
I asked this question previously without response, so I'll rephrase it. I have a VB6 app which uses a third party menu/toolbar activex control. The app includes a commonly found option, "Use...
4
by: Suhaib | last post by:
Hi All, I'm using VS 2005 8.0.50727.42 (RTM.050727-4200), with .NET framework 2.0. Everything was working fine, but now suddenly I don't see my ToolBox icons, whether you are in design mode or...
8
by: sh | last post by:
Does anyone have a favorite source for icons that go well with the various VB controls. I'm looking for business oriented icons.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.