How To force to stay in a tabpage

S

Stan Sainte-Rose

First, I thank you Herfried.

I have 3 tabpages in a tabcontrol.
I would like to force the user to stay in the current tabpage until he
doesn't correctly fill some textboxes.
I know how to prevent bad entries but if I click onto another tabpage, I can
leave the current tabpage.
I try to use the select property but it doesn't work.
Any idea ?

Stan
 
C

Cor

Hi Stan,

I don't know if Herfried is the only one who should answer, but when not,

I think I would just make a routine that is like this in the
tabcontrol.click event.
(not really tested)
private tabpageready as integer = 99
\\\
if tabpageready = 99 then
tabpageready = tabcontrol.selectedindex
else
tabcontrol.selectedindex = tabpageready
end if

And then in every tabpage when it is ready set tapageready to 99.
///

Just a thought

Cor
 
H

Herfried K. Wagner [MVP]

* "Stan Sainte-Rose said:
First, I thank you Herfried.
Why?

;-)

I have 3 tabpages in a tabcontrol.
I would like to force the user to stay in the current tabpage until he
doesn't correctly fill some textboxes.
I know how to prevent bad entries but if I click onto another tabpage, I can
leave the current tabpage.
I try to use the select property but it doesn't work.

This code shows how to detect when the selected tab changes:

<http://www.google.de/[email protected]>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top