Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ReOrder Pages in a PageFrame at Run-Time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00862654
Message ID:
00862671
Vues:
15
Hi Tracy,

You might try using the Pages collection of the PageFrame (rather than the Objects collection) inside your DO WHILE loop.

However, as an alternative...
have you considered storing the contents of each desired page in a Container, load the container objects into an array/collection and drop/arrange them onto the necessary pages whenever/however you want?

(I actually have a PageFrame class somewhere that does this -- let me know if it'll help you and I'll dig it up)


>How to reorder pages in a pageframe at runtime? The below obviously will not work...
>
>Any ideas?
>
>
>DIMENSION pagename(5,2)
>pagename(1,1) = "appscrn1.spr" && i.e. 'appscrn1' is a pagename on the form
>pagename(2,1) = "appscrn2.spr"
>pagename(3,1) = "appscrn3.spr"
>pagename(4,1) = "appscrn4.spr"
>pagename(5,1) = "appscrn5.spr"
>FOR i = 1 TO ALEN(pagename,1)
>   pagename(i,2) = i  && the array row is the pageorder value
>ENDFOR
>
>DODEFAULT()
>i = 1
>WITH THIS.PageFrame1
>  i = 1
>  lnitem = 0
>  DO WHILE i <= .pagecount
>    lnitem = ASCAN(pagename,.objects(i).name)
>    IF lnitem = 0
>      	.REMOVEOBJECT(.objects(i).name)
>    ELSE
>      *--There already is a page 3 so the below will not work if
>      *--linitem is 3
>      *--The page whose pageorder value is 3 now will be changed
>      *--to another value but we haven't gotten there yet
>      .objects(i).pageorder = lnitem  && error - this pageorder value is already used of course
>      i = i + 1
>    ENDIF
>  ENDDO
>ENDWITH
>RETURN .T.
>
>
>TIA
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform