Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ZOrder Woes
Message
 
À
11/05/2007 00:35:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01224223
Message ID:
01224675
Vues:
20
I'm not sure what you mean by "manually shifting page tabs". We're not talking about
a pageframe.

I have a tabstrip control that I wrote. It is a container, and each tab is a container.
They are similar to the tabs you see in VS 2005. See these shots:
http://marois-consulting.com/stuff/example.jpg
http://marois-consulting.com/stuff/overview.jpg


When I click a tab, I want to bring it to the front, so I call ZOrder(0).

But, when that happens, their ordinal position the Controls collection changes,
so code that loops through it, like below, no longer works as expected.

The loop below positions each tab left to right. It gets called whenever I
add a new tab, or change the caption (and subsequently the width) of a tab.

But since each tab's position is no longer sequential in the order they were
added, they get positioned in the wrong order.




>Hi Kevin,
>
>Ow, my head hurts. If I interpret this correctly, you're manually shifting page tabs but then getting hosed by ZOrder?
>
>I think I ran into this before. Mind you, this is not a complete solution but an idea.
>
>Once you start mucking about manually changing the positioning of the page tabs you have to abandon using ZOrder because it's now totally confused. Maybe I'm oversimplifying, but why isn't the Page associated with the tab automatically getting focus? Or is it that you don't want just the Page to be activated but the Page and tab to be moved to the front of all others?
>
>Can you clarify? Thanks.
>
>>ZOrder is changing the order of the controls in the .Controls property.
>>
>>I have the following code that repositions tabs in a tabset:
>>
>>
>>nLeft = 0
>>FOR nControl = 1 TO .ControlCount
>>
>>	oControl = .Controls[nControl]
>>
>>	IF LOWER(oControl.Class) = "mytab"
>>
>>		oControl.Left = nLeft
>>		
>>		IF nControl > 1
>>			oControl.Left = oControl.Left - 7
>>		ENDIF			
>>	
>>		nLeft = oControl.Left + oControl.Width
>>	
>>	ENDIF
>>
>>ENDFOR
>>
>>
>>The problem is that when a tab is clicked, I use ZOrder(0) to bring the tab in front of
>>all others.
>>
>>Since ZOrder is changing the order of the controls in the .Controls property, the above code
>>no longer works.
>>
>>I'm open to suggestions on this.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform