I have created a base form which has a control, so the forms that inherit from this base form must overwrite the Click
event of this control.
Event of a control of the Base Form:
public partial class CustomFormBase : Office2007Form
{
public CustomFormBase()
{
InitializeComponent();
}
private void bubbleBar1_ButtonClick(object sender, DevComponents.DotNetBar.ClickEventArgs e)
{
BubbleButton button = sender as BubbleButton;
switch (button.Name)
{
case "bubbleButtonNuevo":
MessageBox.Show("Nuevo");
break;
case "bubbleButtonEditar":
MessageBox.Show("Editar");
break;
case "bubbleButtonGuardar":
MessageBox.Show("Guardar");
break;
case "bubbleButtonBuscar":
MessageBox.Show("Buscar");
break;
case "bubbleButtonEliminar":
MessageBox.Show("Eliminar");
break;
case "bubbleButtonSalir":
MessageBox.Show("Salir");
break;
}
}
}
Then the form that inherits from this base has to overwrite the event, in order to create New, Edit, Save, Search, Delete, Exit .
In this image I show a form that inherits from CustomFormBase
.
I need to overwrite the event that is in the form that inherits from CustomFormBase
, which I show above.
public partial class Form1 : CustomFormBase
{
public Form1()
{
InitializeComponent();
}
//Deso sobreescribir evento de control bubbleBar1_ButtonClick
}