This example demonstrates how to used the masked (flag) enum drop down widget to select enum flags.

| Language: C# |
using Nevron.Nov;
using Nevron.Nov.Dom;
using Nevron.Nov.Editors;
using Nevron.Nov.Graphics;
using Nevron.Nov.Layout;
using Nevron.Nov.Text;
using Nevron.Nov.UI;
using Nevron.Nov.Windows.Forms;
using System.Windows.Forms;
namespace NovWinFormsProject
{
public partial class Form1 : Form
{
#region Constructors
public Form1()
{
InitializeComponent();
// Set form title
Text = "NOV WinForms - NMaskedEnumDropDownExample";
// Create the NOV example and its controls
NWidget exampleContent = CreateExampleContent();
NWidget exampleControls = CreateExampleControls();
if (exampleControls != null)
{
exampleControls.PreferredWidth = 300;
}
// Place the example and its controls in a pair box
NPairBox pairBox = new NPairBox(exampleContent, exampleControls);
pairBox.FillMode = ENStackFillMode.First;
pairBox.FitMode = ENStackFitMode.First;
pairBox.Margins = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing);
// Host the example in the form
NNovWidgetHost host = new NNovWidgetHost(pairBox);
host.Dock = DockStyle.Fill;
Controls.Add(host);
}
#endregion
#region Example
public NWidget CreateExampleContent()
{
NMaskedEnumDropDown dropDown = new NMaskedEnumDropDown();
dropDown.VerticalPlacement = ENVerticalPlacement.Top;
dropDown.HorizontalPlacement = ENHorizontalPlacement.Left;
dropDown.ColumnCount = 2;
dropDown.EnumType = NDomType.FromType(typeof(ENTableStyleOptions));
dropDown.Initialize();
dropDown.EnumValue = ENTableStyleOptions.FirstRow;
return dropDown;
}
public NWidget CreateExampleControls()
{
return null;
}
public string GetExampleDescription()
{
return @"
This example demonstrates how to used the masked (flag) enum drop down widget to select enum flags.
";
}
///
/// Gets the relevant documentation links for the example
///
///
public (string Name, string Url)[] GetDocumentationUrls()
{
return new[]
{
("Combo Box", "https://www.nevron.com/docs/openvision/ui-combo-box.html"),
("Drop Down Edits Overview", "https://www.nevron.com/docs/openvision/ui-drop-down-edits-overview.html"),
("Toggle Buttons", "https://www.nevron.com/docs/openvision/ui-toggle-buttons.html"),
};
}
#endregion
#region Implementation
#endregion
#region Event Handlers
#endregion
#region Fields
#endregion
#region Static Methods
#endregion
#region Constants
#endregion
#region Nested Types
#endregion
}
}