开发者

.net special button design control

I have the following programming task (Visual Studio .net - no web application) where I wonder if there is maybe some sort of custom control (Third Party?), which could be useful:

There is a rectangular layout and it should be possible to create and move around rectangular buttons. The user should be able t开发者_如何学运维o create button and adjust properties like color, picture, set a text etc on the user level. It should also be possible to set custom properties for a button. Ideally it should be possible to align buttons on a grid, muti-select, etc.

Does anyone know if I have to create that from scratch or is there something that makes my live easier..

Thanks


If you are using WinForms, you might want to look at the DesignSurface, which allows you to add a designer surface to your app... you can move buttons around like the Visual Studio designer. Check it out :

http://msdn.microsoft.com/en-us/magazine/cc163634.aspx


Simple example of moving a standard button around based on mouse position here.

You can create controls that inherit from existing controls to make life easier. Check this out from MSDN

As for moving controls and such around on the form, you can create events that override and trap the mouse down event and actually change the location values (x,y) based on mouse movement. You can also interact with any of the other properties as well based on mouse movement or color change and text value....

For example, if i want to change the button color on mouse over. I would override the mouse over method of my custom control that inherits from the button. I will set the color in this method when its trapped.

You can even override onPaint and handle all the drawing yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜