How do you make different shaped controls (heart, star, circular etc.) ?

I bought a book on custom controls, but they do not say anything on making them with a different shape to the norm :-(

This is for a Uni project for developing a visual programming language for Neverwinter Nights. It will assist the user in the scripting side, by allowing them to build up an event (Give gold to Player) by manipulating graphical objects that represent components of the event(s), then on the press of a "Save" the finished product will be saved as a script.

I want to make these graphical object appear like peices of a puzzle, but I do not know how to make controls with any other shape than the default.

Any help will be very much appreciated :-)

I am not familiar with Neverwinter Nights.
However it appears you are delving into graphical programming. It is a very exciting field, and I suggest getting a book on the subject. By dove tailing that with your component building book, you should be able to build just about anything.

There are two basic approaches. You can use bitmaps, or vector based (Pen drawn) objects. Create a base class to handle the typical drawing methods, and subclass the rendering methods to draw the image with the Paint event.

The topic is too deep for this forum, but you can check out this website for a basic demo.
The Shape class is a good tutorial for you to expand upon in building graphical components.

Have fun!

Excellent. Thanks Jerry. That's exactly the information I needed.

I do happen to have both a custom controls book and a graphics programming book:

.NET 2.0 Windows Forms and Custom Controls in C#
.NET 2.0 Graphics Programming
and... .NET Game Programming in C# (I'm a bit too free with my money!)

The info in the link combined with the two books and I should be merilly making my own unique shaped controls in no time (or a long time... perserverence!)

Thanks again

This article has been dead for over six months. Start a new discussion instead.