views:

309

answers:

1

Hi.

Im a C# coder with a intresst in building new GUI components. Have seached google for some info on creating GUI components not belonging to any current standard, with out mutch luck.

In short I want to be able to build my own components/controllers to be used for the application.

The thing is I had an alternerate idea for creating a alternate way to create/draw a (not so parent, child based) right-click mouse-button menu. So far it seams like the only way to do this is by involing [DllImport("user32.dll")] for example to be able to draw stuff outside of a form or controller.

So I thought I might ask here to hear if anyone has experices how to handel alternet GUI components like an alternet mouse-click-menu, and be able to draw components like this outside of the controlling form och controller.

Question, Is the only proper way to do this by involing [DllImport("user32.dll")] for example to draw what is needed directy to the screen?

EDIT:
Ok, I will try to be more precis.
I want to be able to create grafical components to be used by WinForms for example. In this case, an alternate way to build menu systems and not only parent-child as the windows stardard right click menu is built.
Just to take WinForm as an example, what I try to change with the mouse-menu when it comes to GUI presentation. Create a WinForm component that is round and not square shaped as WinForm is.

Create GUI components, not use the one that exists. and in this case a way for building a alternate mouse-menu to be used.

+1  A: 

There's no end of tutorials and other resources for WinForms available. Here's a link which has a context menu (right-click menu) example.

In general you shouldn't need to use user32.dll directly in your code, unless you have a very specific reason for doing so.

Update: If you don't want to be bound to any specific technology like WinForms or WPF, then you might want to work at the user32.dll level in C or C++ directly. However, you can create fairly flexible controls in C# - see this article for an example, or this one.

Vinay Sajip
Yes, you are absolutly right. But I dont want to be bound to WinForms. I want to be able to create grafical components to be used by WinForms. In this case above an alternate way to build menu systems and not only parent-child.Just to take WinForm as an example what I try to change with the mouse-menu as this is about mostly when it comes to GUI presentation. Create a WinForm component that is round and not square shaped as WinForm is.Create GUI components, not use them.