User control - questions.

  • Thread starter Thread starter Mr. X.
  • Start date Start date
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 :)
 
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
 
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 :)
 
Back
Top