Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simulate setfocus in grid.afterrowcolchange method
Message
De
10/04/2003 15:58:29
 
 
À
10/04/2003 13:36:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00775732
Message ID:
00776298
Vues:
21
Hi Claude, I tested this by putting the setfocus in the click of the control in the grid's column and emailed a sample form to you. I cannot post the code because of the limits in DEFINE CLASS with grids and ADD OBJECT.

>>Is nqty a column in the grid? If so, try setting the focus to that column in the grid using grid.column.setfocus. If not, what is the name of the control on the form that holds nqty? Also, remember that the AfterRowColChange event doesn't fire unless the When event nqty returns true (.T.).
>>
>>Still, I am confused as to why you would do this. How would you ever edit or step through the grid with this method? Everytime you change columns or rows in the grid it will shift focus to nqty and you would never move through the grid.
>
>I did not write the original code, but this is what it does. Grid is read/only and displays a list of issued stock items. Clicking on a line displays the stock number and number of items ordered for the stock number in two text boxes. One of them is the text box for number of items ordered which can be changed and updated. What the original programmer intended (I think) was that when a user clicked on a line the cursor would then move to the text box for items ordered so it could be changed and then update by clicking on an update button. To do this the afterrowcol change method for the grid had the line
>
> ThisForm.NQTY.SetFocus()
>
>which causes an error. This cause the error message that setfocus is not valid in this method. Not sure why user never noticed this before.
>
>Question: is there a way to move the cursor to the desired text box?
>
>>
>>>This has problably been ask and answered but I could not find it.
>>>
>>>VFP 7
>>>
>>>In a grid on a form there is code in the afterrowcolchange method which had the code
>>>
>>> ThisForm.NQTY.SetFocus()
>>>
>>>in it (nqty is a field on the form), which is invalid. Is there a way of to move the cursor to that field in the afterrowcolchange method?
.·*´¨)
.·`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"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform