Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid EditBox Click Conundrum
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01146528
Message ID:
01146545
Views:
17
Hi Barbara,

I thought setting the grid's allowcellselection to .f. would negate setting focus to any specific control anyway?


>I think the problem comes from the fact that the control is readonly and not disabled. Does it really need to have focus? If so, then you may just need to set the SelectedForeColor and SelectedBackColor of the column's textbox. But doing so may make it difficult to tell which object has focus.
>
>>After running the below code (page's activate), whenever column2 is clicked on with the mouse, the editbox changes from the highlight color to a white background as though it could be edited. It is readonly though. The other columns and controls do not do this. the goal is to have the highlight remain in all columns when the user clicks in the any column and it works for all columns except for the one where I add a control on the fly. I have obviously broken a setting, but is it obvious which one?
>>
>>
>>		LOCAL loObject
>>		loObject = THISFORM.PAGEFRAME.Occupants.GrdMain.Column2
>>		IF !PEMSTATUS(loObject,'Edit1',5)
>>			WITH THISFORM.PAGEFRAME.Occupants.GrdMain.Column2
>>				.REMOVEOBJECT([Text1])
>>				.ADDOBJECT([Edit1],[EditBox])
>>				.CURRENTCONTROL = [Edit1]
>>				.Edit1.VISIBLE = .T.
>>				.CONTROLSOURCE = "(thisform.ReturnOccAddr())"
>>				.WIDTH = 340
>>			ENDWITH
>>			THISFORM.PAGEFRAME.Occupants.GrdMain.allowcellselection = .F.
>>		ENDIF
>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform