Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Edit boxes in Grids, DynamicBackColor and read-only
Message
From
23/09/2002 03:29:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/09/2002 00:22:49
Jill Derickson
Software Specialties
Saipan, CNMI
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00703238
Message ID:
00703254
Views:
13
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>I have a grid where the first column is a text box, and the other columns are editboxes. I want the backcolor of the editbox to be different if the controlSource (a memo field in a cursor) is not empty. I have the following to achieve that:
>
>
>FOR EACH loCol IN .COLUMNS
>WITH loCol
>  .FONTSIZE = 8
>  .Header1.FONTBOLD = .T.	&& all columns
>
>  IF .COLUMNORDER = 1
>    .Text1.DISABLEDFORECOLOR = .Text1.FORECOLOR
>  ELSE
>    .SPARSE = .F.	&& so we can always see contents of memo field
>
>** set all appts to have yellow backcolor
>    .DYNAMICBACKCOLOR="IIF("+loCol.CONTROLSOURCE+"='',RGB(255,255,255),RGB(255,255,128))"
>  ENDIF
>ENDWITH
>
>
>It works fine UNTIL I make the column/editbox Read-only - then the editbox always has a backColor of white.
>
>To help zero in on the problem, I changed one of the columns that had an editbox to be a textbox, and the color for THAT column apprears properly, i.e., looks like DynamicBackColor works properly for columns w/read only text boxes, but not read only edit boxes.
>
>Any help/insight to this problem? TIA. J

Jill,
When RO it gets color from disabledback/forecolor. Do not set to readonly but control RO indirectly with KeyPress. ie:

if nKeyCode>31
nodefault
endif

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform