Change text color of Calc form control with macro
Posted: Wed Nov 17, 2010 8:43 pm
I'm trying to write a Basic macro that changes the text color of a form button in Calc (v. 3.2.0 for Ubuntu 10.04.1) when the user clicks on the button.
The Control Element Forms reference at http://wiki.services.openoffice.org/wik ... ment_Forms lists a TextColor (long) property, which it defines as "text color of control element." I'm guessing that this is what I am looking for. However, when I write:
assign ButtonClick to the button, and press the button, Calc returns the error: "BASIC runtime error. Property or method not found: TextColor." I have also tried CharColor, but that gives the same result.
Can anyone tell me what I am doing wrong?
Many thanks,
skradus
The Control Element Forms reference at http://wiki.services.openoffice.org/wik ... ment_Forms lists a TextColor (long) property, which it defines as "text color of control element." I'm guessing that this is what I am looking for. However, when I write:
Code: Select all
Sub ButtonClick(oEvent)
Button = oEvent.Source
Button.TextColor = RGB(255,255,255)
End SubCan anyone tell me what I am doing wrong?
Many thanks,
skradus