Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetFocus syntax
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00023700
Message ID:
00023902
Vues:
41
>>>>>>I have a grid that displays the contents of a database.
>>>>>>I can click on each row and have the record pointer
>>>>>>move accordingly. Now, when I click on a record, I want
>>>>>>to update the text boxes that represent each column in the grid, and have the focus set on the first text box.
>>>>>>
>>>>>>I have the following syntax in the click event:
>>>>>>
>>>>>>scatter memvar
>>>>>>show gets
>>>>>>
>>>>>>my_field.setfocus
>>>>>>
>>>>>>I keep getting an error that my_field does not exist.
>>>>>>
>>>>>>What am I doing wrong ??
>>>>>>
>>>>>>TIA.
>>>>>
>>>>>If you have Visual Foxpro what's the idea to use SHOW GETS? It looks like very strange coding. Setfocus() is common method and should be referenced like Thisform.Grid.Column.Setfocus().
>>>>
>>>>thisform.my_field.setfocus should work (vfp needs to know where my_field is located)
>>>
>>>Dave, my_field it's not a textbox, it's supposed to be grid cell.
>>
>>No. my_field is a textbox. I want to update the textbox, (which is a memory variable from a field in the same database that the grid uses,) from whatever record I am on, that I select from the grid. This way, the user can enter something in the textbox and then the grid gets refreshed to reflect the changes. It's not rocket science.
>>
>>The click event is on the cell in the grid. So I take it, I have to do thisform.my_field.setfocus in order to get the focus over onto my textbox, or should I just go back to the 2.6 days and use _curobj=objnum(my_field) ??
>>
>>TIA.
>
>This case Thisform.my_field.setfocus() is OK, and don't go back to 2.x, please. BTW, why don't you want to edit record directly in grid?

Thanks. If I gave my form the name input, do I put input.my_field.setfocus() or leave it as thisform.my_field.setfocus() ??

I do not want to edit the record directly in the grid because the user is totally computer illiterite, and there are some calculations that have to be done, to totals and such.

Thanks again.
Jamie Di Natale
S.D.X. Int'l Consulting
Computer Consulting, Networking and Custom Programming
jamie@s-d-x.com
http://www.s-d-x.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform