Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textcolor of a Dropdowndatawindow

Status
Not open for further replies.

mistermusic

Programmer
Jun 10, 2009
9
US
Hi there

Does anybody know how I can change the font color of dropdowndatawindow-columns by script? I tried a several different options using "modify" but it didn't work out...

Thank you

Thomas
 
Me again... :) I tried to put the dropdowndatawindow into a datawindowchild so I can use the "modify" statement:

DATAWINDOWCHILD dd_child

d_datawindow.getchild(s_field, dd_child)

dd_test.Modify("employee_name.color = " + String(il_color_font))

--> Unfortunately this modify statement returns an error....
 
I don't know that you can change it... But if you can, I believe you'll need to do one or two things to that modify statement.

1.) Use "TextColor" rather than "Color".
2.) Enclose value in quotes.

dd_child.Modify( "emp_name.TextColor = '" + String( ll_color ) + "'" )
 
Thanks for your reply... Unfortunately it doesn't work either.

The modify statement returns the following error message:

Line 1 Column 19: incorrect syntax.'

Any other suggestions?
 
You can do this with a datawindow expression on the font color within the dddw object. If this needs to be dynamic then add an additional column in the SQL select and use setitem on the datawindowchild to modify this column. The text color expression can then use the value in this column to change.

Matt

"Nature forges everything on the anvil of time
 
Meanwhile I found the solution. After the modify-statement of the dddw there was another modify for the "parent field" which somehow caused the dddw to go back into its original layout:

"dddw.modify"

dw_1.Modify("adr_anr_id.background.color = " + String(16777215))

Switching this two lines solved my problem. I have no clue why that is...

Thomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top