Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
In Grid - Stop blinking cursor in text boxes
Message
De
18/07/1998 12:00:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00118934
Message ID:
00118991
Vues:
22
>I use a grid as a visual display. The user may select cells, but they cannot directly edit the text. When I click on these readonly text boxes they get a blinking cursor, which give the impression that the user may type in text. How can I prevent this?
>Thanks,
>Marcus.

One way to stop the cursor from blinking in a readonly control is to not allow the control to get focus if it is readonly. In the when event do:
IF this.readonly
    RETURN .F.
ENDIF
The disadvantage to this is that users cannot cut or paste the value from the control if the control does not receive focus. Depending on your app, this may be unacceptable. There is another solution that is a little trickier to implement, it involves SET CURSOR.
Our controls don't have a InsertionPoint property (MS... are you listening?) so the cursor must be turned off with a SET command. You could implement something in your textbox class like:

textbox.gotfocus
IF this.readonly
    SET CURSOR OFF
ENDIF
and in the lostfocus,
SET CURSOR ON
You have to be careful with this type of design though, because if something happens and lostfocus doesn't fire, you are stuck with SET CURSOR OFF, and SET CURSOR is NOT scoped to the datasession, it is universal.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform