Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine what 1st control on a page is or tabord
Message
From
13/05/2004 13:46:57
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00903578
Message ID:
00903722
Views:
10
I agree and it works great. Thanks Nick!


>You cannot write the methods at runtime, but you always can extend them different ways.
>You can do this with EXECSCRIPT(), or build and compile a prg on the fly.
>
>In this particular case I think you can just get away with writing something like this in every Page.Click() at design time:
>
>
>* whatever in the click code
>DODEFAULT
>LOCAL loControl
>loControl = EVAL(thisform.page1top)
>* You can wrap the previous line in TRY... CATCH just to make sure that
>* thisform.page1top refers to a valid control
>loControl.SetFocus()
>
>
>
>
>
>
>
>>Ok, thanks so much. I now have a form property for each page that has the first control of the page in it. However, when I try to modify the click event of the form in runtime (see below) I return an error. How to modify the click of a page during runtime?
>>
>>
>>IF TYPE('thisform.pageframe1')<>"U"
>>  ipage = 0
>>  mvalue=''
>>  FOR EACH loPage IN THISFORM.PAGEFRAME1.PAGES
>>    ipage = ipage + 1
>>    lnorder = loPage.CONTROLCOUNT
>>    FOR EACH oControl IN loPage.CONTROLS
>>      IF TYPE('oControl.tabstop')="L" .AND. oControl.TABSTOP = .T.
>>	 IF oControl.TABINDEX < lnorder
>>	    lnorder = oControl.TABINDEX
>>	    *** [Nick's change]
>>	    lcFullControlName = SYS(1272, oControl)
>>	    lccommand = 'THISFORM.Page' + TRANSFORM(ipage) + 'top = thisform.GetHierarchy(lcFullControlName)'
>>	    *** [/Nick's change]
>>	    &lccommand
>>	    *Example thisform.page1top='TEXT1' && first control on page1
>>	ENDIF
>>      ENDIF
>>    ENDFOR && oControl
>>    lccommand = 'mvalue=thisform.page'+ALLTRIM(STR(ipage))+'top'
>>    &lccommand
>>    *--HERE is my problem, when I try to modify the click method of the page
>>    *--it returns the error shown below
>>    IF TYPE('mvalue')="C" .and. !EMPTY(mvalue)
>>	*Next Line returns error: CLICK is a method, event or object
>>	loPage.click = lopage.click+CHR(13)+"DODEFAULT"+CHR(13)+mvalue+".setfocus()"
>>    ENDIF
>>  ENDFOR  && Page
>>ENDIF
>>
.·*´¨)
.·`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"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform