FlexFormTabSheet class

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

Remarks

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

This class enable user to do the following,

§    Drag a FlexForm object into another FlexForm object to form a new FlexFormTabSheet sheet.

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

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

§    Group several sheets together by click “Group” button at the right upper corner of the sheet. Once sheets are grouped together, user can activate one page of a sheet; the pages with the same page index of all other grouped sheets will be activated.

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

Examples

The following example shows how to create a FlexFormTabSheet object.

 

public class MyChildForm1 : FlexForm

{

    // ***** //

}

 

public class MyChildForm2 : FlexForm

{

    // ***** //

}

 

public class MDIForm : FlexMDIForm

{

    // ***** //

}

 

public MDIForm ()

{

SuspendLayout();

InitializeComponent();

 

// Create a child form.

MyChildForm1 myChildForm1 = new MyChildForm1();

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

// FlexConstants.m_nUserDefinedControlEndID

myChildForm1.ID = FlexConstants.m_nUserDefinedControlStartID + 1;

// Show the form.

myChildForm1.ShowForm();

 

// Create another child form.

MyChildForm2 myChildForm2 = new MyChildForm2();

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

// FlexConstants.m_nUserDefinedControlEndID

myChildForm2.ID = FlexConstants.m_nUserDefinedControlStartID + 2;

// Show the form.

myChildForm2.ShowForm();

 

// Create a form tabsheet

FlexFormTabSheet sheet = new FlexFormTabSheet();

// 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 child form 1 as one of its pages

sheet.AddPage( myChildForm1, false );

// Insert child form 2 as the first page

sheet.InsertPage( 0, myChildForm2, false );

// Show the sheet

sheet.ShowForm();

 

ResumeLayout( false );

PerformLayout();

}

§      Members

1)   public long ID { get; set; }               

Remarks

Every FlexFormTabSheet 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 selected page.

 

§      Methods

1)   public void ShowForm()               

Remarks

This makes the FlexFormTabSheet sheet visible.

 

2)   public void AddPage(

FlexForm form,

bool bUsingFirstChildInfo)

Parameters

form

Type: FlexForm

The FlexForm is going to be added into the sheet.

 

bUsingFirstChildInfo

Type: bool

If the form is the first page of the sheet, and bUsingFirstChildInfo is true, the sheet will use the form.’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 FlexForm object into the sheet, and append the page at the bottom.

 

3)   public void InsertPage(

int nIndex,

FlexForm form,

bool bUsingFirstChildInfo)

Parameters

nIndex

Type: int

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

 

form

Type: FlexForm

The FlexForm is going to be added into the sheet.

 

bUsingFirstChildInfo

Type: bool

If the form is the first page of the sheet, and bUsingFirstChildInfo is true, the sheet will use the form.’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 FlexForm object into the sheet at a specific position.