Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two grids on the form and SetFocus problem
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00552492
Message ID:
00552511
Vues:
18
This message has been marked as the solution to the initial question of the thread.
Hi!

Then at the top of the InteractiveChange store the value of SelStart in variable, then restore it back at the end of the event. Each time when you change focus or refresh control, the insertion point is moved to the first character in the textbox. Just restore it - instead of the len(this.Text) use stored value.

>>Hi!
>>
>>Try:
>>
>>This.SetFocus()
>>this.SelLength=0
>>this.SelStart=len(this.Text)
>>
>>HTH.
>>
>
>Vlad,
>
>The problem is, that the Lender name is modified, e.g. originally was 1st Bank Boston and the person needs to change it to First Bank Boston. So, each time I have to be on the position, I left it before. I don't want to create my own class for this, though it might be necessary...
>
>>>Hi everybody,
>>>
>>>I have two grids on the form + 2 grid Highlighters by Nick Nekloidov. First grid is based on BldMstr table and displayes Status, Lender Code, Lender Name, Old Lender Code, Old Lender Name. The second grid is based on LenderView and displayes lenders from Lookup Lender table based on the first letter in Lender Name field of the BldMstr table. In other words, when I navigate from record to record I requery() the view, if the first letter changes. I also perform a "soft" seek based on the 4 first letters of Lender Name. It works fine.
>>>However, I added a possibility to edit Lender Name directly on the BldMstr grid. Here is my code in InteractiveChange event of Lender Name textbox:
>>>
>>>********************************************************************
>>>*  Description.......: Lender Name.InteractiveChange
>>>*  Calling Samples...:
>>>*  Parameter List....:
>>>*  Created by........:
>>>*  Modified by.......: Nadya Nosonovsky 09/05/2001 09:59:46 AM
>>>********************************************************************
>>>if this.tag<>this.value && Was changed
>>>	local lcOldValue
>>>	select BldMstr
>>>	if !empty(OldValue)
>>>		lcOldValue=BldMstr.OldValue
>>>	else
>>>		lcOldValue=BldMstr.Lender + '|' + this.tag
>>>	endif
>>>	if thisform.ProcType = 'Trxnmstr'		&& Trans Master Lender maintenance
>>>		replace RevLend with 'E', ;
>>>			Matched with 'E', ;
>>>			OldValue with m.lcOldValue in BldMstr
>>>	else									&& Weekly Transaction Processing
>>>		replace RevLend with 'E', ;
>>>			OldValue with m.lcOldValue in BldMstr
>>>	endif
>>>	thisform.KeyValue=left(this.value,1)
>>>	lcLetter=thisform.KeyValue
>>>	requery('LenderView')
>>>	=seek(left(this.value,4),'LenderView')
>>>	thisform.grdLender.refresh()
>>>*	thisform.grdLender.SetFocus()
>>>*!*		this.SetFocus()
>>>endif
>>>dodefault()
>>>
>>>As you can see, I commented out two last lines, because it causes "reverse" typing, e.g. the user tries to quickly type "first", but it shows like "tsrif".
>>>
>>>So, my question is: is it possible to highlight the record in grdLender, but have ability to work with grdBldMstr? It's not critical and my manager and user accepted, that the record on the second grid is highlighted only after he/she leaves this column, but it would be nice to have this record highlighted at the same type, he/she types.
>>>
>>>Thanks in advance.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform