VirualPanelSheet class

It represents a container that contains multiple panels/sheets that have the same docking style.

Remarks

The VirualPanelSheet is useful for minimizing screen space usage while allowing an application to expose a large amount of data. A VirualPanelSheet consists of at least two FlexPanel / FlexPanelTabSheet objects that have the same docking style. The contents of all the FlexPanel / FlexPanelTabSheet objects in a VirualPanelSheet are always visible at the same time.

User can drag page out of the virtual sheet by dragging the page. You can also drag a FlexPanel / FlexPanelTabSheet into a virtual sheet to make it one page of the sheet.

 

Examples

The following example shows how to create a VirualPanelSheet 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 virtual sheet

VirtualPanelSheet sheet = new VirtualPanelSheet();

//Assign the dock style to RIGHT

sheet.FlexDock = FLEX_DOCKING_ALIGN.BOTTOM;

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 VirualPanelSheet 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.

 

§      Methods

1)   public void ShowPanel()              

Remarks

This make the VirualPanelSheet object visible.

 

2)   public virtual void HidePanel()

Remarks

This make the VirualPanelSheet 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.