Change color of RRButton

Started by Nathan Durland, September 24, 2012, 01:19:50 PM

Previous topic - Next topic

Nathan Durland

I'd like to change the color of an RRBUTTON control on the fly (basically, the buttons are toggles).   I originally tried FF_CONTROL_SETCOLOR, but was unsuccessful.  So I tried this, also without success:

  ''-----------------------------
  ' Update button color
  ''-----------------------------
  tLong1 = IIF(BtnStatus = "Y", OnColor, OffCOlor) ' these are set to %RBG_* value earlier
  SendMessage HWND_CALLFORM_CALLBTN(ControlIndex), %RBM_SETBKCOLOR, tLong1, %True
  FF_Control_Redraw HWND_CALLFORM_CALLBTN(ControlIndex)
  FF_DoEvents


I'm probably missing something pretty obvious (what's new?).  Any advice appreciated.

TIA

Israel Vega Alvarez

#1
For Fore Color you can use:

SendMessage HWND_CALLFORM_CALLBTN(ControlIndex),%RBM_SETTXTCOLOR,%BLUE,0

And for Back Color:

SendMessage HWND_CALLFORM_CALLBTN(ControlIndex),%RBM_SETBTNCOLOR,%YELLOW,0


Israel

Nathan Durland

See?  I knew is was something obvious...

Thanks