TabControl - First Event

R

randy1200

I have a tab control which has several tab pages.

At run-time, switching between the tab pages can take as long as a few
seconds.

Any suggestions on what I can get to fire at the instant the user clicks on
the TabControl? All the event handlers I've tried so far (Click, MouseClick,
SelectedIndexChanged) only fire after the tab page actually changes.?

Thanks,
Randy
 
P

Peter Duniho

I have a tab control which has several tab pages.

At run-time, switching between the tab pages can take as long as a few
seconds.

Any suggestions on what I can get to fire at the instant the user clicks
on
the TabControl? All the event handlers I've tried so far (Click,
MouseClick,
SelectedIndexChanged) only fire after the tab page actually changes.?

Why does it take so long to switch between tab pages? Is there something
you can do to speed that up? "A few seconds" seems inordinately long to
switch between tabs to me, by at least one order of magnitude, if not more.

That said, you could probably intercept the mouse clicks in the parent
form, checking the mouse position to see whether it's inside the
TabControl but outside a TabPage (which would mean it's possibly inside
one of the tabs itself, meaning the click would lead to the possible
switch of a tab page).

Another question is why do you want something to happen the instance the
user clicks on the TabControl? What operation do you want to do, and why
is it so time-critical in a situation where the user isn't going to see
any UI reflecting the event right away anyway?

Knowing the answer to those questions could very well lead to some better
solution to whatever problem you're really trying to solve than the method
you're attempting now.

Pete
 

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