TabStrip doesn't raise events

The place for threads about TimoSoft TabStrip.
Post Reply
TickTick
Lt. Commander
Posts: 54
Joined: 17 Feb 2009, 01:41

TabStrip doesn't raise events

Post by TickTick »

I don't know if it's a bug. I think not, but it's pretty annoying...
In your sample the TabStrip control raises events like Click, MouseDown, etc. But when I add a second tabstrip to it (or to a completely new project), I do not get any events for the control that I have added, and I just can't figure out what I'm doing wrong.
Hans
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: TabStrip doesn't raise events

Post by TiKu »

Have a look at the property DisabledEvents (also configurable at design time via the property pages). Most events are disabled by default to increase performance.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
TickTick
Lt. Commander
Posts: 54
Joined: 17 Feb 2009, 01:41

Re: TabStrip doesn't raise events

Post by TickTick »

Thanks!
I didn't know that it wouldn't show up in the properties (I don't mean the property sheet) and that it could only be accessed by property sheet or by code.
I don't know about others, but to me a TabStrip without click events is useless (I need an event in which I can set .ZOrder for my pictureboxes), that's why I am wondering why you chose to not set having events as a default).
I believe you had your reasons, but it's not comfortable.
Hans.
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: TabStrip doesn't raise events

Post by TiKu »

The Click event isn't what you're looking for. It is raised if the user clicks anywhere on the control. It is NOT raised if the user activates another tab (which also can be done by code or by keyboard).
You should use the ActiveTabChanged event, which never is disabled.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
TickTick
Lt. Commander
Posts: 54
Joined: 17 Feb 2009, 01:41

Re: TabStrip doesn't raise events

Post by TickTick »

Hello!
I made a few mistakes... I have to admit it!!
I see that by default all events are enabled (looking at the property sheet), so please accept my apologies...
Out of interest... how would I trigger a Click event? I click everywhere on the TabStrip, but nothing happens. Not that I need this event (thanks so much for your explanation on the ActiveTabChanged), but I wonder how it can ever be raised.
Hans
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: TabStrip doesn't raise events

Post by TiKu »

TickTick wrote:I see that by default all events are enabled (looking at the property sheet)
No, that's not right. The property is called DisabledEvents. So any event in the list that is checked, is disabled and not enabled.
TickTick wrote:Out of interest... how would I trigger a Click event? I click everywhere on the TabStrip, but nothing happens. Not that I need this event (thanks so much for your explanation on the ActiveTabChanged), but I wonder how it can ever be raised.
Remove the check mark next to "Click events". Then it will work.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Post Reply