FlexPanelTabSheet class

It represents a container that contains multiple panels that share the same space on the screen.

Remarks

The FlexPanelTabSheet is useful for minimizing screen space usage while allowing an application to expose a large amount of data. A FlexPanelTabSheet consists of at least two FlexPanel objects that share the same screen space. Only one FlexPanel in a FlexPanelTabSheet is visible at a time. When a user select the tab of a FlexPanel, the contents of that FlexPanel become visible and the contents of the other FlexPanel obejcts are hidden.

 

§    Drag a FlexPanel object into another FlexPanel object to form a new FlexPanelTabSheet sheet.

§    Drag a page out of the sheet by dragging the tab.

§    Drag a FlexPanel into a sheet to make it one page of the sheet.

§    Drag a FlexPanelTabSheet object and dock it at any place during run time.

§    Can hide a FlexPanelTabSheet object by click at its “Pin” button.

§    The visibility of a FlexPanelTabSheet object can also be turned on/off.

Examples

The following example shows how to create a FlexPanelTabSheet object.

 

public class MyPanel1: FlexPanel

{

    // ***** //

}

 

public class MyPanel2: FlexPanel

{

    // ***** //

}

 

public class MDIForm : FlexMDIForm

{

    // ***** //

}

 

public MDIForm ()

{

SuspendLayout();

InitializeComponent();

 

// Create a panel.

MyPanel1 myPanel1 = new MyPanel1();

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

myPanel1.ID = FlexConstants.m_nUserDefinedControlStartID + 1;

// Show the panel.

myPanel1.ShowPanel();

 

// Create another panel.

MyPanel2 myPanel2 = new MyPanel2();

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

myPanel2.ID = FlexConstants.m_nUserDefinedControlStartID + 2;

// Show the panel.

myPanel2.ShowPanel();

 

// Create a panel tabsheet

FlexPanelTabSheet sheet = new FlexPanelTabSheet();

// Assign the dock style to RIGHT

sheet.FlexDock = FLEX_DOCKING_ALIGN.LEFT;

sheet.Size = new Size( 400, 400 );

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

sheet.ID = FlexConstants.m_nUserDefinedControlStartID + 3;

// Add panel 1 as one of its pages

sheet.AddPage( myPanel1, false );

// Insert panel 2 as the first page

sheet.InsertPage( 0, myPanel2, false );

// Show the sheet

sheet.ShowPanel();

 

ResumeLayout( false );

PerformLayout();

}

 

§      Members

1)   public long ID { get; set; }               

Remarks

Every FlexPanelTabSheet object should have a unique ID. If its value is between FlexConstants.m_nUserDefinedControlStartID and FlexConstants.m_nUserDefinedControlStartID, then its layout will be persistent; otherwise, its layout will not be saved.

 

2)   public virtual FLEX_DOCKING_ALIGN FlexDock { get; set; }

Remarks

Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent. It can be one of the following values,

§    NONE:             

The control is not docked.

§    TOP:                

The control's top edge is docked to the top of its containing control.

§    BOTTOM:         

The control's bottom edge is docked to the bottom of its containing control.

§    LEFT:              

The control's left edge is docked to the left edge of its containing control.

§    RIGHT:             

The control's right edge is docked to the right edge of its containing control.

 

3)   public int SelectedIndex { get; set }

Remarks

Gets or sets the index of the currently selected tab page.

 

§      Methods

1)   public void ShowPanel()              

Remarks

This make the FlexPanelTabSheet object visible.

 

2)   public virtual void HidePanel()

Remarks

This make the FlexPanelTabSheet object invisible.

 

3)   public void AddPage(

FlexPanel panel,

bool bUsingFirstChildInfo)

Parameters

panel

Type: FlexPanel

The FlexPanel is going to be added into the sheet.

 

bUsingFirstChildInfo

Type: bool

If the panel is the first page of the sheet, and bUsingFirstChildInfo is true, the sheet will use the panel.’s parameters, such as size, location, and docking style, to create it. If the sheet already has other pages, then this parameter will be ignored.

 

Remarks

Add a FlexPanel object into the sheet, and append the page at the bottom.

 

4)   public void InsertPage(

int nIndex,

FlexPanel panel,

bool bUsingFirstChildInfo)

Parameters

nIndex

Type: int

The page index of the FlexPanel is going to be inserted into the sheet.

 

panel

Type: FlexPanel

The FlexPanel is going to be added into the sheet.

 

bUsingFirstChildInfo

Type: bool

If the panel is the first page of the sheet, and bUsingFirstChildInfo is true, the sheet will use the panel.’s parameters, such as size, location, and docking style, to create it. If the sheet already has other pages, then this parameter will be ignored.

 

Remarks

Insert a FlexPanel object into the sheet at a specific position.

 

5)   public void InsertToolStrip(

FlexToolStrip toolstrip,

int nRowIndex,

int nColIndex)               

Parameters

toolstrip

Type: FlexToolStrip

The toolbar is going to be added into the panel.

 

nRowIndex

Type: int

The index of the row that the toolbar will be inserted.

 

nColIndex

Type: int

The index of the column that the toolbar will be inserted.

 

Remarks

This adds a toolbar into the sheet.

 

Example:

public class MyToolbar: FlexToolStrip

{

    // ***** //

}

 

public class MyPanel1: FlexPanel

{

    // ***** //

}

 

public class MyPanel2: FlexPanel

{

    // ***** //

}

 

public class MDIForm : FlexMDIForm

{

    // ***** //

}

 

public MDIForm ()

{

SuspendLayout();

InitializeComponent();

 

// Create a panel.

MyPanel1 myPanel1 = new MyPanel1();

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

myPanel1.ID = FlexConstants.m_nUserDefinedControlStartID + 1;

// Show the panel.

myPanel1.ShowPanel();

 

// Create another panel.

MyPanel2 myPanel2 = new MyPanel2();

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

myPanel2.ID = FlexConstants.m_nUserDefinedControlStartID + 2;

// Show the panel.

myPanel2.ShowPanel();

 

// Create a panel tabsheet

FlexPanelTabSheet sheet = new FlexPanelTabSheet();

// Assign the dock style to RIGHT

sheet.FlexDock = FLEX_DOCKING_ALIGN.LEFT;

sheet.Size = new Size( 400, 400 );

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

sheet.ID = FlexConstants.m_nUserDefinedControlStartID + 3;

// Add panel 1 as one of its pages

sheet.AddPage( myPanel1, false );

// Insert panel 2 as the first page

sheet.InsertPage( 0, myPanel2, false );

// Show the sheet

sheet.ShowPanel();

 

// Create a toolbar.

MyToolbar myToolbar = new MyToolbar();

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

myToolbar.ID = FlexConstants.m_nUserDefinedControlStartID + 4;

// Show the toolbar.

myToolbar.ShowToolStrip();

 

// Add the toolbar into the sheet at row 0, column 0

sheet.InsertToolStrip( myToolbar, 0, 0 ); 

 

ResumeLayout( false );

PerformLayout();

}

 

6)   public void SetMenuStrip(

LinsMenuStrip menystrip)                 

Parameters

menustrip

Type: LinsMenuStrip

The menubar is going to be added into the panel.

 

Remarks

This sets the menustrip as the menubar of the sheet.

 

Example:

public class MyMenubar: LinsMenuStrip

{

    // ***** //

}

 

public class MyPanel1: FlexPanel

{

    // ***** //

}

 

public class MyPanel2: FlexPanel

{

    // ***** //

}

 

public class MDIForm : FlexMDIForm

{

    // ***** //

}

 

public MDIForm ()

{

SuspendLayout();

InitializeComponent();

 

// Create a panel.

MyPanel1 myPanel1 = new MyPanel1();

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

myPanel1.ID = FlexConstants.m_nUserDefinedControlStartID + 1;

// Show the panel.

myPanel1.ShowPanel();

 

// Create another panel.

MyPanel2 myPanel2 = new MyPanel2();

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

myPanel2.ID = FlexConstants.m_nUserDefinedControlStartID + 2;

// Show the panel.

myPanel2.ShowPanel();

 

// Create a panel tabsheet

FlexPanelTabSheet sheet = new FlexPanelTabSheet();

// Assign the dock style to RIGHT

sheet.FlexDock = FLEX_DOCKING_ALIGN.LEFT;

sheet.Size = new Size( 400, 400 );

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

sheet.ID = FlexConstants.m_nUserDefinedControlStartID + 3;

// Add panel 1 as one of its pages

sheet.AddPage( myPanel1, false );

// Insert panel 2 as the first page

sheet.InsertPage( 0, myPanel2, false );

// Show the sheet

sheet.ShowPanel();

 

// Create a menubar.

MyMenubar myMenubar = new MyMenubar();

// Assign a unique ID which is between FlexConstants.m_nUserDefinedControlStartID and

// FlexConstants.m_nUserDefinedControlEndID

myMenubar.ID = FlexConstants.m_nUserDefinedControlStartID + 4;

// Show the menubar.

myMenubar.ShowMenuStrip();

 

// Set myMenubar as the main menu of the sheet

sheet.SetMenuStrip( myMenubar ); 

 

ResumeLayout( false );

PerformLayout();

}