Home All Groups Group Topic Archive Search About

Creating an event by force.

Author
10 Jun 2010 10:06 PM
Mr. X.
Hello,
I want to create an event by force.
How can I do that ?

(for example : ToolStrip.ItemClicked event)

Thanks :)

Author
10 Jun 2010 10:13 PM
Martin H.
To the dark side this path leads.
Explain your request you should.

Yoda
Author
10 Jun 2010 10:25 PM
Family Tree Mike
On 6/10/2010 6:06 PM, Mr. X. wrote:
> Hello,
> I want to create an event by force.
> How can I do that ?
>
> (for example : ToolStrip.ItemClicked event)
>
> Thanks :)

Do you mean SomeToolstrip.Items (0).PerformClick()?

--
Mike
Author
11 Jun 2010 9:53 AM
Mr. X.
Thanks,
specific, this help.
I need more generic solution (I would like to do any event, not only the
PerformClick event).

Thanks :)

Show quoteHide quote
"Family Tree Mike" <FamilyTreeM***@ThisOldHouse.com> wrote in message
news:OYJxZvOCLHA.2012@TK2MSFTNGP02.phx.gbl...
> On 6/10/2010 6:06 PM, Mr. X. wrote:
>> Hello,
>> I want to create an event by force.
>> How can I do that ?
>>
>> (for example : ToolStrip.ItemClicked event)
>>
>> Thanks :)
>
> Do you mean SomeToolstrip.Items (0).PerformClick()?
>
> --
> Mike
Author
11 Jun 2010 10:52 AM
Phill W.
On 11/06/2010 10:53, Mr. X. wrote:

> I need more generic solution (I would like to do any event, not only the
> PerformClick event).

If a class doesn't provide you with a method to do something, then
perhaps it's something that you shouldn't do?

Why do you want to fire off any event from any control?

Regards,
    Phill  W.
Author
11 Jun 2010 12:12 PM
Armin Zingler
Am 11.06.2010 00:06, schrieb Mr. X.:
> Hello,
> I want to create an event by force.
> How can I do that ?
>
> (for example : ToolStrip.ItemClicked event)
>
> Thanks :)

You are taking the wrong approach. If you want
to do something, call a method. If you want
the same thing to be done if the item is clicked,
call the same method from the click event handler.

--
Armin