Hi everyone,
I'm using VS 2005 and have just realised it has this cool test harness
for testing user controls. Previously, I had to create a test harness
myself to test the functionality of the user controls i was developing.
So this is definitely a very big plus in VS 2005.
I am currently working on a project that will require me to know how
this harness was coded. What my application needs to do is basically
load some control (whose name is specified by a configuration read from
the database) display it in some area of a windows form, let the user
interact with it and then when the user clicks on the OK button, read
the "value" property (or any other specified) of the control and store
it somewhere.
For instance, assume the DB configuration says control="textbox"
(perhaps for clairty the entire name "System.Windows.Forms.TextBox") .
The app should load the textbox, display it on the form, let the user
type some text and then when he clicks on the OK button, read the
"text" property of the control and store it. A similar scenario could
occur for a Combo box only that perhaps for a combo extra stuff needs
to be done to load and pass on the Display/Value pairs to use in the
combo.
What I need, is to figure out a way to load any named control as the
UserControlTestContainer.exe does, let the user interact with it and
capture a particular property's value of the control. The named control
could be a standard VB.Net control or even a custom user control I have
done.
I suspect the implementation will have to do with Reflection so a good
pointer in this direction or a URL on where i can get the code for VS
2005's UserControlTestContainer.exe will be invaluable.
regards,
sienko