Author Topic: does pawstextbox class have bg color for the text?  (Read 257 times)

toffler

  • Wayfarer
  • *
  • Posts: 1
    • View Profile
does pawstextbox class have bg color for the text?
« on: April 06, 2016, 09:09:07 pm »
Hi all,

In Windows there is SetBkColor that sets background color for the text in a text box. It only applies to the actual text and is different from hbrBackGround that sets the background for the whole text box.

Is there an analog of SetBkColor in pawstextbox?

My problem is that I have a long textbox and I don't want to set bg color for the whole length of the box, only for the text that is there atm.

Thank you!

Neeno

  • Traveller
  • *
  • Posts: 29
    • View Profile
    • GreatShift
Re: does pawstextbox class have bg color for the text?
« Reply #1 on: April 07, 2016, 11:12:22 am »
no, I don't think so.
You could probably create a TextBox like this:
Code: [Select]
pawsTextBox* label;
csString text = "text";
csRect frame = label->GetDefaultFrame();
frame = label->GetWidgetTextRect(text, frame.xmin, frame.ymin);
label->SetRelativeFrameSize(frame.Width(), frame.Height());
label->SetText(text);
label->SetBackgroundColor(0, 0, 0);
and place it on top of an other widget with a different background color.