Tab Control - First Event...Again

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.

In case it's not obvious, the user are okay with waiting a few seconds if
they have a visual indication something is happening (like a progress bar).
The users are not okay with just waiting to see if something eventually
happens.

Again, the question is about what event can I use immediately after the
mouse click on the tab control. Redesigning an application done by someone
who's long gone is not an option right now, and posting rhetorical questions
instead of answering the question asked is not helpful.

Thanks,
Randy
 
C

Chris Shepherd

randy1200 said:
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.

This should only be true the first time, unless there's some kind of
processing that happens *every* time a tab gets focus.

Controls on TabPages don't actually exist until they would be shown the
first time, and the construction of these controls may explain the long
loading time. Without knowing specifically whether it is every time you
switch or just the first time, it's hard to rule out possible causes.
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.
In case it's not obvious, the user are okay with waiting a few seconds if
they have a visual indication something is happening (like a progress bar).
The users are not okay with just waiting to see if something eventually
happens.

Again, the question is about what event can I use immediately after the
mouse click on the tab control. Redesigning an application done by someone
who's long gone is not an option right now, and posting rhetorical questions
instead of answering the question asked is not helpful.

Have you run through the debugger to determine exactly what it is doing
on the change of the tabpage that is taking so long?


Chris.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

What do the tabpages contains that it takes that long to display?

Are you doing any processing in the tabindex_change event?
 
P

Peter Duniho

[...]
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.

In case it's not obvious, the user are okay with waiting a few seconds if
they have a visual indication something is happening (like a progress
bar).
The users are not okay with just waiting to see if something eventually
happens.

Why are you starting a new thread? Why not just update the previous
thread you had, answering the questions I asked when I replied to that
one? My questions weren't rhetorical in my previous reply, they aren't
here, and if you insist on treating them as they are, you're never going
to get answers that will help you.

You'll notice that you elicited two more replies, both of which are very
much in the same vein as my original reply that you've ignored.

Until you explain _why_ your tab control takes so long to switch tabs,
it's not possible to discuss possible solutions. While I already provided
one suggestion for how you might intercept the user's action earlier, I
doubt that's really the right solution. You should be focusing more on
the performance and responsiveness side of things than on getting the user
input at a specific time.

In any case, you would do well to be less dismissive of those who try to
help you. That sort of thing is a great way to get people to just not
care at all about whether you ever get an answer.

Pete
 
C

Chris Shepherd

Peter said:
Why are you starting a new thread? Why not just update the previous
thread you had, answering the questions I asked when I replied to that
one? My questions weren't rhetorical in my previous reply, they aren't
here, and if you insist on treating them as they are, you're never going
to get answers that will help you.
You'll notice that you elicited two more replies, both of which are very
much in the same vein as my original reply that you've ignored.


Yeah, I noticed that this was a duplicate thread after I'd already
responded (I have my news reader sort newest posts first), else I would
have mentioned this in my reply and instead replied to the original thread.

When posters do this sort of thing, it makes me at least not want to
reply (when I catch it), because it tells me that even if I give them
useful advice they likely aren't going to read it anyways.

Chris.
 
R

randy1200

Many thanks for the replies. The answer from Chris made it pretty easy to
figure out where to look for and find the problem.

I found an OnSelectedItemChanging() in a base class that was in turn
publishing to subscribers that access the database. In essence, changing the
tab was calling the database.

I don't know what other people are using, but I'm accessing this through the
MSDN web page. The post I made last week got one response, and I know this
because I always click the "Notify me of replies" button. When I simply
scrolled down through the posts this morning, my post from last week is not
in the list. I just looked again to see if maybe I was being careless, but I
still don't see my post from last week by simply scrolling. I included
"...Again" to emphasize I'm not just shotgunning with the posts.

I think some of Pete's comments got off the subject. Rather than dwell on
that, I'll ask what people are using for newsgroup readers that include a
"Notify me of replies" button.

Randy
 
C

Chris Shepherd

randy1200 said:
I don't know what other people are using, but I'm accessing this through the
MSDN web page. The post I made last week got one response, and I know this
because I always click the "Notify me of replies" button. When I simply
scrolled down through the posts this morning, my post from last week is not
in the list. I just looked again to see if maybe I was being careless, but I
still don't see my post from last week by simply scrolling. I included
"...Again" to emphasize I'm not just shotgunning with the posts.

Just because you only get one response doesn't mean you should repost a
new thread. Pete asked you pretty well what I did (for more detail), and
again, all that's proving is that you would ignore people trying to help
you because you don't think they're asking the right things to help you.

If it was some random poster's name you'd never seen before, maybe I
could understand that. Pete is quite a prolific poster here and is
always good about providing quality advice and responses.
I think some of Pete's comments got off the subject. Rather than dwell on
that, I'll ask what people are using for newsgroup readers that include a
"Notify me of replies" button.

I am using Thunderbird and just have it set to automatically watch
threads to which I have replied (via a message filter), so I get a small
eye icon next to those threads.

Chris.
 

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

Similar Threads


Top