Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Texbox in grid does not recieve focus
Message
De
19/04/2000 16:09:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/04/2000 16:00:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00361420
Message ID:
00361540
Vues:
16
>>>>>I have a textbox in a grid where I trap for the return key in the keypress event:
>>>>>
>>>>>
>>>>>IF nKeycode = 13
>>>>>  NODEFAULT
>>>>>  Thisform.pEdit()
>>>>>Endif
>>>>>
>>>>>
>>>>>The only problem is the keypress event never fires! For that matter, I put a wait window in the gotfocus event, and that event never fires either. Can anyone enlighten me as to what may be going on here?
>>>>
>>>>
Maybe textbox is not the CurrentControl or Dynamiccurrentcontrol. In BRCC this could work better :
>>>>
if lastkey()=13 and !mdown()
>>>>  NODEFAULT
>>>>  Thisform.pEdit()
>>>>Endif
Cetin
>>>
>>>
What does BRCC stand for?
>>
>>
Grid.BeforeRowColumnChange
>>If it's only for a specific column then add control to check Column's nIndex too. nIndex parameter in BRCC might not work for you if columns are reordered. Instead something else like this would be better :
>>
*Grid.BeforeRowColumnChange
>>LPARAMETERS nColIndex
>>if this.columns(.FindColumn(nColIndex)).Name = "myCheckColumn" and ...
>>*...
>>
>>* Grid custom FindColumn.Method
>>lparameters nColIndex
>>local ix
>>with this
>>	for ix = 1 to .columncount
>>		if .columns(ix).ColumnOrder = nColIndex
>>			return ix
>>		endif
>>	endfor
>>endwith	
Cetin
>>
>>
>>
>>Cetin
>
In the when event of my grid, I loop through all the columns and set the curretcontrol to my textbox, but the gotfocus event of the textbox is still not firing. The BRCC is firing for sure, but it's like the textbox is being completely ignored.


James,
I would bet there is another class code setting currentcontrol to something else after you. Also it would be sufficient to set it in PEM sheet or init.
In afterrowcolchange of grid put this code temporarily to check :

wait window this.columns(this.ActiveColumn).Currentcontrol timeout 2

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform