How to: Create ButtonEdit Control in Code

The following code creates a ButtonEdit control and places it onto a panel:

The code changes the button collection as follows:

The example subscribes to the ButtonEdit.ButtonClick event to respond to button clicks.


ButtonEdit btnEdit1 = new ButtonEdit();
btnEdit1.Width = 100;
btnEdit1.Properties.Buttons[0].Kind = ButtonPredefines.OK;
btnEdit1.Properties.Buttons.Add(new EditorButton(ButtonPredefines.Delete));

btnEdit1.ButtonClick += BtnEdit1_ButtonClick;

private void BtnEdit1_ButtonClick(object sender, ButtonPressedEventArgs e) {
    ButtonEdit editor = sender as ButtonEdit;
    if(e.Button.Kind == ButtonPredefines.OK) {
    if (e.Button.Kind == ButtonPredefines.Delete) {