blah blah blah is here! blah blah » Close

up0down
link

Guys, is it possible to fire an event on the form from a button click, i want to call the below event if possible?

private void comboCalendar_AppointmentChanged(object sender, ComponentGo.Calendars.AppointmentEventArgs args)
{
//event code
}


Then the above would be fired by something like below?

private void testToolStripMenuItem_Click(object sender, EventArgs e)
{
comboCalendar_AppointmentChanged(sender,e)
}


But that doesn't work? would it possible that i'm way off the mark here?

last answered one year ago

2 answers

up1down
link

are you using the eventarguments in comboCalendar or the sender, if so try not to use them because you are passing the toolstripmenuitem params to it which are different.

Ahh yes i see what you mean muster, thanks, I'll rework that method.

up1down
link

If all you want to do is to call the 'event code' in the comboCalendar_AppointmentChanged eventhandler and that code doesn't use the 'sender' or 'args' parameters, then I'd just move the code into a separate method.

You can then call this method from both the eventhandler and from anywhere else in the same form.

Feedback