473,657 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Con trols

<ToolboxBitmap( GetType(OS.WinF orms.Controls.P rogressBar),
"ProgressBar.ic o")> _
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 1663
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.Con trols

<ToolboxBitmap( GetType(OS.WinF orms.Controls.P rogressBar),
"ProgressBar.ic o")> _
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*******@gmai l.com> wrote in message
news:11******** **************@ d56g2000cwd.goo glegroups.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.Con trols

<ToolboxBitmap( GetType(OS.WinF orms.Controls.P rogressBar),
"ProgressBar.ic o")> _
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*******@gmai l.com> wrote in message
news:11******** **************@ d56g2000cwd.goo glegroups.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.Con trols

<ToolboxBitmap( GetType(OS.WinF orms.Controls.P rogressBar),
"ProgressBar.ic o")> _
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.Co ntrols.Progress Bar", so the filename of the Icon had to be
"OS.WinForms.Co ntrols.Progress Bar.ico"

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

Namespace OS.WinForms.Con trols

<ToolboxBitmap( GetType(Progres sBar), "ProgressBa r")> _
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*******@gmai l.com> wrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.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*******@gmai l.com> wrote in message
news:11******** **************@ d56g2000cwd.goo glegroups.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.Con trols
>>
>> <ToolboxBitmap( GetType(OS.WinF orms.Controls.P rogressBar),
>> "ProgressBar.ic o")> _
>> 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
3801
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 address itself. Just about all websites that use said icons use one of these two methods (some use both even) to make them appear (in the code of a webpage.) : <LINK REL="icon" HREF="/icon.ico" TYPE="image/ico"> <LINK REL="SHORTCUT ICON"...
4
10367
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
2015
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 all sorts. the net, groups, icon extractors (i had 15000 on my drive, but they were all icons, not toolbar icons) so, please, where can i source toolbar icons?
2
1892
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 (that of Windows XP icons)... So, which control to be used for putting these icons on the form... I have tried putting Image Control and added my icon as resources in the project but while I import that icon, it gets bad black border instead of...
0
1770
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 about the icons that most of programs use, like: STD_COPY, STD_CUT, STD_DELETE, STD_FILENEW, STD_FILEOPEN and so on. This is very useful because you don't need to load these icons as resources anymore, because they exist already in system. My...
2
2000
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 using the ExtractIconEx API function (see code below). I found that all the icons windows uses are not necessarily in the Shell32.dll file, though. I did some digging, and found a few other places where Icon files are being pulled from to be...
7
3100
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 as follows: Friend F0 As frmMain Friend F1 As frmStart Friend F2 As frmSearch Then in my ShowPage routine (which is passed a string "pageToShow" which is the name of the form I wish to open), I first check to see if we already have an instance...
0
1104
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 Large Icons". With the third party control, using multi-res icons (which include alpha channel icons) results in the correct size and resolution. I would like to use the native controls in VB2005 if possible. I note that in the VB2005 IDE and...
4
4156
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 not, it's the same. Doing reset toolbox comes with all the icons, but they are all disabled except HTML controls. If you select "Choose Toolbox Items" then ".NET framework components" property tab comes with this error message - "An error occurred...
8
1543
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
8421
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
8325
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,...
1
8518
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
5643
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
4173
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...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
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.