We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Causing events to fire

Thread ID:

Created:

Platform:

Replies:

2351 Jan 10,2003 06:53 PM UTC Windows Forms 0
loading
Tags: FAQ
djackman
Asked On January 10, 2003 06:53 PM UTC

Does anyone know how to cause events for controls to fire without using the UI? I'm trying to write some unit tests for my winforms, making sure they do the correct things, but I don't know how to make the event fire generally. There is a PerformClick function on menu items and buttons which works for these cases, but I'm looking for something a bit more general. Also, I'm having a problem with PerformClick as well. It seems the event processing is synchronous here, so if my event handler calls ShowDialog on a form, then the dialog appears and the test waits until the dialog is closed. What I'd like to do is have the dialog get started on a different thread (which would also have the message pump) so my test thread could then find the dialog form and manipulate it then close it. Does anyone know of a way to do this?

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;