On 29-sep-06, at 14:36, Arnaud Nicolet wrote:
Your code is slightly different than the one I posted.
See yourself, there is no method calling itself infinitely:
I rewrite the code I posted without the extra informations:
if me.value=2 then
me.value=MyLastIndex
else
MyLastIndex=me.value
end if
So:
you select the 3rd tab (which is the value of 2).
The "me.value=MyLastIndex" line is executed. Indeed, this calls
"another instance" of the Change event, which executes the second
block (MyLastIndex=me.value). Then, the second instance leaves the
sub, and, then, the first instance also leaves. You can't have an
infinite call unless MyLastIndex becomes 2, which is not possible
here.
Ah, fine point indeed (but makes all the difference in the world)
Indeed, it would be more elegant to disable the tab, but it's not
possible.
Another way, if you are using RB 2005 or 2006, would be to remove
completely the tab. As I don't use RB 2005, I can't predict if
embedded controls are also removed/hidden or if they are going to
another tab, etc.
The LR states that the embedded controls will be removed at the
same time. Rebuilding the page with code (rebuilding all controls)
was too much off a hassle so I choose the method mentioned above.
Yes. Also, you could move all the controls to the window (with a
loop: if self.control(i).tabpanelIndex=2 then) and make them
invisibles.
You make them visibles again and place them on the tabpanel if you
want them back.
I don't think I'll need it (they may see the controls, but can't use
them), but I'll keep it in mind
Bart
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>