CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 7/9/2004 10:38:13 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 67 Favorited: 0 Favorite
7 Items, 1 Pages 1 |< << Go >> >|
midi25
Asp.Net User
<ToolBoxBitmap> Attribute help needed. Thanks7/9/2004 10:38:13 AM

0/0

Hi I have created a component.

I now want to add it to my toolbox with an icon. I am using the <ToolBoxBitmap> attribute.

But I am getting an error message.

Attribute 'ToolboxBitmapAttribute' cannot be applied to 'Generate' because the attribute is not valid on this declaration type.

Here is my code. What could be wrong. Thanks

---------------------------------------------------------------------------
Imports System.Drawing
Public Class Randon_COM

Inherits System.ComponentModel.Component

<ToolboxBitmap(GetType(Randon_COM))> _

Public Function Generate(ByVal a As Integer, ByVal b As Integer) As Integer
Dim ran As Random
Generate = ran.Next(a, b)
Return Generate
End Function
End Class
MCAD.Net vb.net
joteke
Asp.Net User
Re: <ToolBoxBitmap> Attribute help needed. Thanks7/9/2004 10:53:15 AM

0/0

This attribute is applied to a class/control for which the icon is presented. E.g just before class declaration. As the error msg tries to state, you rae now trying to apply it to a functio´n.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingtoolboxbitmapattributeclasstopic.asp


Thanks,

Teemu Keiski
Finland, EU
midi25
Asp.Net User
Re: <ToolBoxBitmap> Attribute help needed. Thanks7/9/2004 10:58:55 AM

0/0

Thanks I just tried it before the class declaration and it works.


Only problem is now that when I try to add my component its coming up with a message box saying "Ghost.bmp"

Its not liking my bitmap for some reason.

This is how I am calling.

<ToolboxBitmap("GHOST.bmp")> _

The bmp is in my application dir and set to embed in the dll.
Any ideas what could be giving me this prob.

Thanks
MCAD.Net vb.net
midi25
Asp.Net User
Re: <ToolBoxBitmap> Attribute help needed. Thanks7/9/2004 11:06:18 AM

0/0

I,ve done it. Thanks

That page helped. I worked it all out from there.

First time I have ever done this. Am delighted.

Thanks

joteke
MCAD.Net vb.net
joteke
Asp.Net User
Re: <ToolBoxBitmap> Attribute help needed. Thanks7/9/2004 11:14:05 AM

0/0

It looks the image from the same folder where the assembly itself is.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDrawingToolboxBitmapAttributeClassctorTopic1.asp

Also does the image fullfill the requirement (16x16 size)?


Thanks,

Teemu Keiski
Finland, EU
master4eva
Asp.Net User
Re: <ToolBoxBitmap> Attribute help needed. Thanks7/10/2004 10:40:08 AM

0/0

FYI: It does not have to be the same folder. Basically, you can set the namespace of the resources dynamically... and the IDE just gets the resource named "{namespace}.{class_name}.bmp" where the {namespace} and {class_name} is determined by the control.

Just had to snag you there Teemu ;-) .
-- Justin Lovell
joteke
Asp.Net User
Re: <ToolBoxBitmap> Attribute help needed. Thanks7/12/2004 9:40:13 AM

0/0

I meant the particular overload I sent the link about, but seems that I looked this wrong way. Originally it was about looking the image from resource file (GetType for the attribute ctor), but I kind of lead user to use the another overload, right? :-)

I will deal with you later. ;-)


Thanks,

Teemu Keiski
Finland, EU
7 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
TheMSsForum.com >> VB >> ToolboxBitMap Attribute - The Microsoft ... Thanks for your help. Tag: ToolboxBitMap Attribute Tag: 351637 .... since the values may be needed even if no instance of the derived class exists. ...
Nabble - Mono - MonoDevelop IDE - Special icons in Monodevelop ... Something like the ToolboxBitmap attribute from winforms. Thanks in advance, .... This is what I needed, thanks ! ...
CodeProject: Windows XP style Collapsible Panel Bar. Free source ... Then you don't even need to specifiy the ToolboxBitmap attribute, it does it all for you ... Many thanks to Russell Morris for his help fixing this problem. ...
Adding custom components to toolbox... - GameDev.Net Discussion Forums Using this attribute you can specify a different file name, or even steal the ... Thanks so much for the help. I'm totally thrilled now. ...
TheMSsForum.com >> Csharp >> toolboxbitmapattribute - The ... Favorites/Registry Help Needed! I am making a web browser in C#. I need help doing the ..... using ToolboxBitmap attribute Thanks & Regards, Manikandan ...
.NET Framework Jul 8, 2006 ... Hi all thanks to give me you point of view regarding this question. ... There is a problem with the ToolBoxBitmap attribute in VS2005/. ...
Collection properties in ASP.Net Server Controls (Building a ... When you use the above attributes VS.Net provides its default Collection Editor for ..... Thank You. I needed some help. i put the tab in a Master Page. ...
CodeProject: Roll your own ASP.NET Chart Control. Free source code ... The ToolboxBitmap Attribute is used to supply a custom icon for your control. ..... Thank you. I have only two questions about the tool if you can help me ...
Extending ASPX Panel Control to produce Rounded Corners The "ToolboxBitmap" attribute is where we specify the bitmap that will be displayed ..... It's possible to solve? Please, could you help us? Thanks Mike ...
Design-Time Integration You can achieve the same result without using ToolboxBitmap- Attribute: Simply ... a comprehensive set of attributes, shown in Table 9.1, to help you modify ...




Search This Site:










error message doesn't display for username requiredfieldvalidator

submit form data to database

filling a drop down list from a database

want to fire other button's click event

range validation quirk

develope a chat application with conference chat

reading text file problem.

how to set cssclass for a control?

changing <object src="" in page_load

setting the default button for a textbox

use variable as variable name.

regular expressions to do advanced matches in arabic?

the page cannot be found

2 dropdownlists, 2nd is filtered from the first. how can i handle the postback?

treeview with drill down/into data

using findcontrol in nested collections.

trouble creating visual studio project on remote server

exception handling from dal to bll to webforms?

textbox control in repeater

passing data to a asp user control (ascx)

page freeze when iframe is loading

disable hot keys using c#

redirecting url in frameset without clicking hyperlink

how to create master page in asp.net 1.1 pls send as soon as possible

how to send webpage as email

accessing controls in listview c#

browser compatibility

open a site in a table....

calendar date problem

how to select items in server side?

  Privacy | Contact Us
All Times Are GMT