User control - questions.

M

Mr. X.

Hello.
In VB, VS 2008, I am creating a user control.
1. How can I set the user control : default event handler?
2. With System.Drawing.ToolboxBitmapAttribute.GetImageFromResource I can
resolve existing controls little picture beside toolbox.
How can I set my own user control toolbox bitmap ?

Thanks :)
 
O

Onur Güzel

Hello.
In VB, VS 2008, I am creating a user control.
1. How can I set the user control : default event handler?
2. With System.Drawing.ToolboxBitmapAttribute.GetImageFromResource I can
resolve existing controls little picture beside toolbox.
 How can I set my own user control toolbox bitmap ?

Thanks :)  

Regarding to Q1: You need to mark your control class with
"DefaultEvent" attribute:
http://msdn.microsoft.com/en-us/library/system.componentmodel.defaulteventattribute.aspx

HTH,

Onur Güzel
 
M

Mr. X.

About question 2 - I see the attribute : ToolboxBitmap,
but I didn't figure what to write for a resource (how can I add one ?)
Need an example, please.

Thanks :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top