Due to my ControlLibrary is getting huge, I thought explain it as I finished the parts, and then publish it as article in codeproject. Here is a screenshot of the RibbonMenuButtonControlTest.
The interesting properties I created are:
- Arrow: ToRight or ToDown.
- ColorBase,ColorOn,ColorPress (not more back images, more customizable).
- GroupPos: Left,Center,Right,Top,Bottom.
- ImageLocation : L,R,C,T,B.
- ImageOffset (Autoscales).
- Radius (of corners button).
- ShowBase: to show base or not.
- SplitButton: to convert in multiple click event.
- Split Distance : to set the size of the contextmenu button part.
- FadingSpeed: how fast is the transtition from base to oncolor and back.
I have to add the final touches and if you want to add another functionality, tell me, I'll be grateful to know your opinion and I'll try to add it.
If you want to learn with this controls, I recommend you to take a look to:
- this.Region: thats a good way to avoid matters of transparency.
- LinearGradient with multiple colors, that makes easy the gradients.
- MeasureString : thats a good method to position the text (Beacuse you have to take away the base.OnPaint -> you have to do ALL, including write the text).
- Transform Colors Method including Alpha opacity.
- The DrawArc Method: As you can see with the radius you can make smooth corners
- OnMouseUp: Here you can see what happens when the is SplitButton is activated.
Tomorrow or next, you will see the fantastic RibbonRoundButton. (Another thing, I'm Spanish and I want to improve my English. Could you tell me my faults in the articles? Thank's)