Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TextBox.SelStart
Message
De
04/01/2000 12:51:58
 
 
À
04/01/2000 12:20:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00312429
Message ID:
00312531
Vues:
51
>Dear Ed:
>
>I test what you said. I don't run. I don't know if I explain the the issue O.K.
>
>The only problem is if you type the same code into a textBox that are in a grid.
>The code don't run. I don't want to make a subclass, only edit the GotFocus() event of the TextBox.
>

In order to change the GotFocus event of the textbox, you need to either do instance alteration of the textbox, where you change the code in the individual textbox instance, or create a subclass so that all instance of that class have the same code.

You can't do instance alteration of the textbox class within a grid, because each row of the grid instantiates a distinct instance of the textbox. The solution is to create a new class derived from the textbox base class that contains the behavior you want in the GotFocus. Doing that and adding the subclass to the column automatically adds the behavior to each instance without having to go in and change the behavior by hand each time.

>Why the code run O.K. in a TextBox (MyForm.TextBox) and don't run in a TextBox that are inside of a Grid (MyForm.MyGrid.MyColumn1.TextBox)? It's the same code and different results.
>

A textbox on a form is a single instance of a textbox; you can make instance changes. A textbox added to a column represents many distinct instances of the textbox.

>I think that the gotfocus() event of the TextBox, isn't the last event when the TextBox are inside a Grid. What event occurs after?
>

It has nothing to do with the order that events are fired, it has to do with how a Grid control behaves. You need to modify the class and not the instance of the class.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform