Sunday, January 2, 2011

FlexMDIForm class of LinsUI Layout Manager 2.1

It is a container for multiple-document interface child forms.
§      Methods
1)  public void InsertToolStrip(
FlexToolStrip toolstrip,
int nRowIndex,
int nColIndex)               
Parameters
toolstrip
Type: FlexToolStrip
The toolbar is going to be added into this MDI container.

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 this container.

Example:
public class MyToolbar : FlexToolStrip
{
    // ***** //
}

public class MDIForm : FlexMDIForm
{
    // ***** //
}

public MDIForm()
{
SuspendLayout();
InitializeComponent();

// 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 + 1;
// ***************************** //
//      Add menu items here      //
// ***************************** //
// Show the toolbar.
myToolbar.ShowToolStrip();

// Add the toolbar into the MDI container at row 0, column 0
InsertToolStrip( myToolbar, 0, 0 ); 

ResumeLayout( false );
PerformLayout();
}

2)  public void SetMenuStrip(
LinsMenuStrip menustrip)                 
Parameters
menustrip
Type: LinsMenuStrip
The menustrip will be set as the menu of this MDI container.

Remarks
This will set a menustrip as the menu of this MDI container.

Example:
public class MyMenubar : LinsMenuStrip
{
    // ***** //
}

public class MDIForm : FlexMDIForm
{
    // ***** //
}

public MDIForm()
{
SuspendLayout();
InitializeComponent();

// 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 + 1;
// ***************************** //
//      Add tool items here      //
// ***************************** //
// Show the menubar.
myMenubar.ShowMenuStrip();

// Set the menubar as the main menu of the MDI container
SetMenuStrip( myMenubar ); 

ResumeLayout( false );
PerformLayout();
}

No comments:

Post a Comment