Re: Simulating events. Calling Click on a button
- From: "Joanna Carter [TeamB]" <joanna@xxxxxxxxxxxx>
- Date: Fri, 4 Aug 2006 09:56:03 +0100
"Pieter Breed" <pieter.breed@xxxxxxxxx> a écrit dans le message de news:
1154680986.609275.131100@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| I would like to simulate UI events on UI controls. For example, I would
| like to make a button control think its been Clicked (from an outside
| class), so it would go through the click animation, raise the
| associated events etc.
|
| Is there a way to do this?
Why not separate out the code into another method and call that method from
the Click event, then you can call the separate method from other code ?
public partial class Form1 : Form
{
public void MyMethod()
{
// do stuff
}
private void button1_Click(object sender, EventArgs args)
{
MyMethod();
}
}
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer
.
- References:
- Simulating events. Calling Click on a button
- From: Pieter Breed
- Simulating events. Calling Click on a button
- Prev by Date: Re: Flickering of gradient rectangle
- Next by Date: Re: Flickering of gradient rectangle
- Previous by thread: Simulating events. Calling Click on a button
- Next by thread: Re: Simulating events. Calling Click on a button
- Index(es):