C# Class SIL.FieldWorks.Common.Widgets.VSTabControl

This class supports rendering of TabControl correctly when using bottom alignment with visual styles enabled. When ones are disabled the default method of rendering is used. Adapted from XPTabControl by Vladimir Svyatsky.
Inheritance: System.Windows.Forms.TabControl
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
DrawCustomTabControl void
DrawTabItem void
GetImageByIndexOrKey Image
HitTest int
InitializeDrawMode void

Public Methods

Method Description
VSTabControl ( ) : System

Initializes a new instance of the T:VSTabControl class.

Protected Methods

Method Description
OnFontChanged ( EventArgs e ) : void

Raises the E:System.Windows.Forms.Control.FontChanged event.

OnHandleCreated ( EventArgs e ) : void

This member overrides M:System.Windows.Forms.Control.OnHandleCreated(System.EventArgs).

OnPaint ( PaintEventArgs e ) : void

Raises the E:System.Windows.Forms.Control.Paint event.

WndProc ( Message &m ) : void

This member overrides M:System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message@).

Private Methods

Method Description
DrawCustomTabControl ( Graphics g, Rectangle clipRect ) : void

Draws our tab control.

DrawTabItem ( Graphics g, int index, TabItemState state, Rectangle tabRect, StringFormat textFmt ) : void

Draws certain tab.

GetImageByIndexOrKey ( int index, string key ) : Image

This function attempts to get tab image by index first or if not set then by key.

HitTest ( ) : int

Gets hot tab index.

InitializeDrawMode ( ) : void

Turns custom drawing on/off and sets native font for the control (it's required for tabs to adjust their size correctly). If one doesn't install native font manually then Windows will install ugly system font for the control.

Method Details

OnFontChanged() protected method

Raises the E:System.Windows.Forms.Control.FontChanged event.
protected OnFontChanged ( EventArgs e ) : void
e System.EventArgs An that contains the event data.
return void

OnHandleCreated() protected method

This member overrides M:System.Windows.Forms.Control.OnHandleCreated(System.EventArgs).
protected OnHandleCreated ( EventArgs e ) : void
e System.EventArgs An that contains the event data.
return void

OnPaint() protected method

Raises the E:System.Windows.Forms.Control.Paint event.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs A that contains the event data.
return void

VSTabControl() public method

Initializes a new instance of the T:VSTabControl class.
public VSTabControl ( ) : System
return System

WndProc() protected method

This member overrides M:System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message@).
protected WndProc ( Message &m ) : void
m System.Windows.Forms.Message A Windows Message Object.
return void