1

I want my wxButton to have a black background and white text for it's label. I tried this sample code only I also tried it with wxButton and SetBitmapLabel.

All I could manage was to get the bitmap to display, however I also want the button's text (label) to be displayed over the bitmap at the same time. How could I do this?

ChrisX
  • 334
  • 1
  • 5
  • 20

1 Answers1

1

It's not clear what do you want to use a bitmap at all if just want to display the text. What's wrong with just doing

wxButton* b = new wxButton(...); // possibly use wxBORDER_NONE style
b->SetBackgroundColour(*wxBLACK);
b->SetForegroundColour(*wxWHITE);

?

Also notice that since wxWidgets 3.0 the functionality of wxBitmapButton is available in wxButton itself, i.e. you can set a bitmap for any button and it will be displayed in addition to the text.

VZ.
  • 21,740
  • 3
  • 39
  • 42