views:

179

answers:

0

Hello, I'll share my cue with everyone!

My Form Base Class is frmExportBase.cs, so any Windows Form that I will create or use have to inherit from it, so this will be fine :

namespace SResocentroAnalytics.Forms
{
    public partial class frmExportCobranzaDiaria : frmExportBase
    {
        public frmExportCobranzaDiaria()
        {
            InitializeComponent();

        }


    }
}

On my frmExportBase, I drag and dropped a ToolStrip with some controls and the most important is one Button (ToolStripButton). So I dont know how to perform the normal Flow behavior as the following :

  1. User open frmExportCobranzaDiaria Form (ToolStrip is already loaded from the parent control)
  2. User select a range of dates using DateTimePickers Controls on ToolStrip (using frmExportCobranzaDiaria)
  3. User raise the event btnParenButton_Click when him clicked btnParenButton control (on frmExportCobranzaDiaria ->ToolStrip)
  4. System process data ...

1,2 task already completed, My issue is the third task, I was looking for delegates and raisers events, so I tryed some snippers as the follows :

//declare delegates and events for trying raise manually the btnParenButton_Click event
        public delegate void SearchByParentControls(object o, EventArgs e);
        public event SearchByParentControls MainUpdated;

try to reconfigure base click event on frmExportBase

   private void btnParenButton_Click(object sender, EventArgs e)
        {
            MainSearch += new SearchByParentControls(btnSearch_Click);
            base.Invoke(MainSearch);    
        }

Thanks for your time and responses!