Custom controls

A

amity

Hello friends,

actually i want to create a custom control in c#.net.But the problem is
that -----when i create custom controls and use them in the windows
form then they craete errors in the designer of the
form..............for example if i create a control which shows three
images and we can change these images independently then how can i make
the control so that the first time when the control loads it loads the
default images....also what should be the path of these default
images.........??
 
K

Kevin Spencer

Put the images into a project resource file, and load them from there.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Magician

A man, a plan, a canal.
a palindrome that has gone to s**t.
 
A

amity

thanks Kevin

But can you give me a link where i can find the tutorials for custom
controls creation.....

regards,

amity
 
K

Kevin Spencer

Hi amity,

Your best bet to start out is to inherit System.Windows.Forms.UserControl.
This Control automatically adds design-time support for the most part. You
can read about it here:

http://msdn2.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx

Here's a more general section that explains developing Custom Windows Forms
Controls in a variety of articles and how-tos:

http://msdn2.microsoft.com/en-us/library/6hws6h2t.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Magician

A man, a plan, a canal.
a palindrome that has gone to s**t.
 

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