Hi,
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?
Regards,
Pieter
Joanna Carter [TeamB] - 04 Aug 2006 09:56 GMT
| 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

Signature
Joanna Carter [TeamB]
Consultant Software Engineer
Trevor Benedict R - 05 Aug 2006 19:21 GMT
Checkout the PerformClick Method.
Regards,
Trevor Benedict R
> Hi,
>
[quoted text clipped - 7 lines]
> Regards,
> Pieter
Pieter Breed - 07 Aug 2006 05:53 GMT
Thanks Trevor, this is exactly what I had in mind...
pieter
> Checkout the PerformClick Method.
>
[quoted text clipped - 13 lines]
> > Regards,
> > Pieter