Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid, textbox in a container in a column
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00127736
Message ID:
00128074
Vues:
41
>>>>>I have a grid that in column 1 has a container in it. The container has an image and a textbox control on it. The .DynamicCurrentControl for column 1 is filled with a call to a function to determine what picture to put in the image control. In that function there is also a check to see if the font for the textbox should be bold or not. The .DynamicFontBold has an IIF() statement to bold the active row.
>>>>>
>>>>>This is all working........except that the bold characteristic of the textbox in the container does not display bold unless focus is NOT on that textbox. One can see this in two ways..if focus is in some other column, the textbox displays bold very nicely. Once focus is in the textbox, the bold goes away even though the property is still .T. You can also see it when focus is in the textbox and you hit a navigation key the textbox will become bold for a brief second as focus is transferred to another row.
>>>>>
>>>>>The textbox is also a searchable one. The coloring mechanisms for the class work fine in other grids but not here. Whatever is holding up the font bold is also holding up the reverse color while searching.
>>>>>
>>>>>I've tried switching .Bound and a host of other ideas but no solution.
>>>>>The bold won't show up unless the textbox does not have focus.
>>>>>
>>>>>Any ideas?
>>>>>
>>>>>Thanks,
>>>>>Steve
>>>>
>>>>What if you will set bold in Form Designer, i.e. include already bold textbox to the container. Now, you can exclude container column from DynamicFontBold setting.
>>>
>>>Only the active row can be bold. The dynamic stuff works fine for the rest of the row. I can't exclude the container as it has an image control on it too.
>>>The image control and textbox go together as a single unit and look in the grid as if they are one column. I can't change that.
>>>
>>>Steve
>>
>>I understand this. Actually, I meant, that it's not necessary to use DynamicBond for the container column. Instead of this you can use few column.container(s) (they might be subclasses of generic class), some of them with bold textbox.
>
>That's true, the Dynamic won't work for the embedded textbox in the container anyway. The container has the textbox added to it at runtime as the grid is constructing itself. I've tried Bruce's suggestion of setting Bold on in the .GotFocus, but that didn't work either. I did manage to get it to work yesterday but only via a workaround. If I set focus to the container, the textbox will bold as it lost focus. It still didn't do the reverse coloring.
>It seems that with a container in the column, there is a disconnect between the column and and the textbox caused by the container. I suppose this is understandable. Whether bound or not, I have to supply the .ControlSource to the textbox. I did try forcing the textbox .LostFocus event to occur but that didn't work either. It seems the cursor must physically leave the textbox for it to work. For the reverse coloring, I directly manipulate .SelStart and .SelLength. The numbers for these are correct and it does correctly reverse color an item when the textbox is simply in the column. But even though the values are correct, no color shows when this textbox is on the container. I'm baffled......and thanks for your help.
>
>Steve

As far as I understand, you can have 4 differently looking containers: 2 different images and 2 different fonts+colors for textboxes, so if you add 4 containers (subclasses) to the same column and set DynamicCurrentControl property, then it should work.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform