|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Icon for ComponentsWhen you create a new component, compile it, and add it to the toolbox, it
comes with that boring gearbox icon next to it. How can you change the icon associated with a new component you create? Imports System.ComponentModel
<ToolboxBitmap("C:\MyPic.bmp")> _ Public Class MyClass .... End Class Obviously, the bitmap file is the path to your bitmat for the toolbox icon. I hope this helps Hmm...instead of referring to a static place on the drive, can I integrate
it into the DLL I create? Like, if I add the bitmap or icon to my project, can I refer to it that way, rather than on the drive of the computer? Show quoteHide quote "Crouchie1998" <crouchie1***@discussions.microsoft.com> wrote in message news:OX06kIkNFHA.688@TK2MSFTNGP10.phx.gbl... > Imports System.ComponentModel > > <ToolboxBitmap("C:\MyPic.bmp")> _ > Public Class MyClass > ... > End Class > > Obviously, the bitmap file is the path to your bitmat for the toolbox > icon. > > I hope this helps > > "OpticTygre" <opticty***@adelphia.net> schrieb: Create a bitmap of size 16 × 16 and give it the name of the class ('Class > When you create a new component, compile it, and add it to the toolbox, it > comes with that boring gearbox icon next to it. How can you change the > icon associated with a new component you create? BlaBla' -> "BlaBla.bmp"). Then you can add the bitmap to the project and set its build action to embedded resource. Extend your code like this: \\\ <ToolboxBitmap(GetType(BlaBla))> Public Class BlaBla . . . End Class /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Ahhh, thanks. That's exactly what I was looking for. Just learning about
attributes, too, so this is another one that gets added to the list. Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:ePxjQRkNFHA.2144@TK2MSFTNGP09.phx.gbl... > "OpticTygre" <opticty***@adelphia.net> schrieb: >> When you create a new component, compile it, and add it to the toolbox, >> it comes with that boring gearbox icon next to it. How can you change >> the icon associated with a new component you create? > > Create a bitmap of size 16 × 16 and give it the name of the class ('Class > BlaBla' -> > "BlaBla.bmp"). Then you can add the bitmap to the project and set its > build > action to embedded resource. Extend your code like this: > > \\\ > <ToolboxBitmap(GetType(BlaBla))> > Public Class BlaBla > . > . > . > End Class > /// > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> Herfried, not sure what you mean by create a bitmap and give it the name of a
Class. I know how to create bitmaps using the image editor and add them add them as embeded resources but don't understand how to give them the name of a class. Could you please explain a bit more...thanks. Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "OpticTygre" <opticty***@adelphia.net> schrieb: > > When you create a new component, compile it, and add it to the toolbox, it > > comes with that boring gearbox icon next to it. How can you change the > > icon associated with a new component you create? > > Create a bitmap of size 16 × 16 and give it the name of the class ('Class > BlaBla' -> > "BlaBla.bmp"). Then you can add the bitmap to the project and set its build > action to embedded resource. Extend your code like this: > > \\\ > <ToolboxBitmap(GetType(BlaBla))> > Public Class BlaBla > . > . > . > End Class > /// > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > > "Dennis" <Den***@discussions.microsoft.com> schrieb: The name of the bitmap file must consist of the class' name with ".bmp" > Herfried, not sure what you mean by create a bitmap and give it the name > of a > Class. I know how to create bitmaps using the image editor and add them > add > them as embeded resources but don't understand how to give them the name > of a > class. Could you please explain a bit more...thanks. appended to the end (class 'Foo', name of bitmap file "Foo.bmp"). -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> I think I understand now. I create a bitmap and name it Foo.bmp then add it
to my UserControl project as an embedded resource. Then it will automatically show up in the ToolBox opposite the UserControl Class Name if I use the ToolBoxBitmap Attribute. Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "Dennis" <Den***@discussions.microsoft.com> schrieb: > > Herfried, not sure what you mean by create a bitmap and give it the name > > of a > > Class. I know how to create bitmaps using the image editor and add them > > add > > them as embeded resources but don't understand how to give them the name > > of a > > class. Could you please explain a bit more...thanks. > > The name of the bitmap file must consist of the class' name with ".bmp" > appended to the end (class 'Foo', name of bitmap file "Foo.bmp"). > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > >
Visual Basic .Net List Box
Hiding items in base classes Problems with pictureboxes and memory usage detect mouse event on node of a treeview How can I loop through all of the messages in the inbox - VB.NET E FTP client newbie stupidity: opening one form and closing another SqlCommand w/ Params Select Issue Using the IN Clause Array.Length vs Array.GetUpperBound(0) -- any real differences? VB.NET - Automation - DLLs |
|||||||||||||||||||||||