views:

119

answers:

1

I need to create a button that has the same style as ButtonSpec with its type set to Context, is there any way to create a ButtonSpec that isn't directly attached to another control, or have I missed a simple style option on another control?

+2  A: 

You cannot get a standalone ButtonSpec but you do not need one. Create a KryptonButton and then set the ButtonStyle to be ButtonSpec and it will draw in the same way as a ButtonSpec that is present in other controls. You could use a KryptonDropButton if you need it to show a KryptonContextMenu when pressed.

Phil Wright
Is there any way to set the button's image to the same image that setting the ButtonSpec.Type might? I already tried setting the ButtonStyle, and it just seems to remove the border from the button.
Alex Lyman
No, you cannot get the image from ButtonSpec.Type. There might be another approach. Try creating a KryptonHeader with a ButtonSpec and then remove all the content of the KryptonHeader.Values. Then remove the drawing of the header background/border and you end up with only a buttonspec!
Phil Wright
Ooo, that'll do. Thanks, Phil!
Alex Lyman