CLR Extender Reference

MenuStrip Sample

Description »

This sample shows you the powerful .NET ToolStrip class in action.

It shows you:

  • How to create a MenuStrip and place it in your form. It does this by using the netbasecontrol as base class and setting the property cControlClass = "system.windows.forms.MenuStrip".
  • How to add several kinds of items to the menustrip (see the Init Event), the following items are added using CLRCreateObject: ToolStripMenuItem (for the File and Edit menu), ToolStripDropDownButton and ToolStripSplitButton.
  • How to handle the ItemClicked event from these items with CLRBindEvent.
  • Using the feature Controls In Menu which lets you add Controls like TextBoxes, CheckBoxes, ComboBox and any .NET Control to your menus.
  • How to play with several variants of ToolStripLayoutStyle. It does so by using the ComboBox (VFP) and setting the oMenu.LayoutStyle property.
  • The sample allows you reorder the items by dragging them while pressing Alt+Click.
  • Using ToolStripSplitButton:
  • And this sample only scratches the surface of the power available to you through the .NET ToolStrip class and company.
Example »

 

Remarks »

The Constants used in the Valid event of the LayoutStyle ComboBox where generated automatically using the Assembly Browser.


Send comments about this topic to eTecnologia.net.