2

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?

Alex Lyman
  • 15,637
  • 3
  • 38
  • 42

1 Answers1

2

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
  • 22,580
  • 14
  • 83
  • 137
  • 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 Sep 26 '08 at 09:47
  • 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 Sep 26 '08 at 09:52