Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 17 Apr 2008 16:16:57 +0200,    group: microsoft.public.dotnet.framework.windowsforms.controls        back       


Custom TabControl - hide/customize left-right buttons   
Hi *,

I have created a custom TabControl (inherited from the default one). The
only thing that's still missing is to customize the behaviour when the
horizontal extension of the tab-strips exceeds the TabControl's width. In
this case, the original TabControl displays those two buttons on the top
right with which one can move between visible and invisible strips.

I wonder as to whether one could ...
 1. find out whether the buttons are being displayed or not and when this 
    happens
 2. hide the buttons and replace them with my custom ones 

1. if there is no property that I overlooked this could at least be done
"manually" by i.e. comparing the overall width of all visible TabStrips to
the width of the control, although I would think that there really should
be some mechanism built into the control. Also, tracking the position of a
tab when i.e. the first one is not the visible one will produce quite some
work I guess.

2. is pretty annoying. It seems that those buttons are kind of "pushed"
into the control without publishing them as one would expect. That is, they
seem to be buried in the Win32 API that the control must be based on. Thus,
I seem to be unable to even retrieve their location and size. Also, drawing
"over" them doesn't work as they will be drawn on top of whatever my code
draws.

Has anyone succeeded in replacing them with their own code ..? 

Cheers,
Olaf
date: Thu, 17 Apr 2008 16:16:57 +0200   author:   Olaf Rabbachin

Re: Custom TabControl - hide/customize left-right buttons   
Would you like to try the XTabControl from SpringSys?





> Hi *,
>
> I have created a custom TabControl (inherited from the default one). The
> only thing that's still missing is to customize the behaviour when the
> horizontal extension of the tab-strips exceeds the TabControl's width. In
> this case, the original TabControl displays those two buttons on the top
> right with which one can move between visible and invisible strips.
>
> I wonder as to whether one could ...
> 1. find out whether the buttons are being displayed or not and when this
>    happens
> 2. hide the buttons and replace them with my custom ones
>
> 1. if there is no property that I overlooked this could at least be done
> "manually" by i.e. comparing the overall width of all visible TabStrips to
> the width of the control, although I would think that there really should
> be some mechanism built into the control. Also, tracking the position of a
> tab when i.e. the first one is not the visible one will produce quite some
> work I guess.
>
> 2. is pretty annoying. It seems that those buttons are kind of "pushed"
> into the control without publishing them as one would expect. That is, 
> they
> seem to be buried in the Win32 API that the control must be based on. 
> Thus,
> I seem to be unable to even retrieve their location and size. Also, 
> drawing
> "over" them doesn't work as they will be drawn on top of whatever my code
> draws.
>
> Has anyone succeeded in replacing them with their own code ..?
>
> Cheers,
> Olaf
date: Thu, 19 Jun 2008 03:41:53 +0800   author:   Martin M

Re: Custom TabControl - hide/customize left-right buttons   
Hi,

Martin M wrote:

> Would you like to try the XTabControl from SpringSys?

actually I have opted to create a TabControl from scratch. The whole
process thus took way longer than planned, but I sure learned a lot as
well. 

Cheers,
Olaf
date: Thu, 19 Jun 2008 09:37:30 +0200   author:   Olaf Rabbachin

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us