I need to generate windows form fields based off of a text file that I am parsing. I also want to automatically generate validation event handlers which all will be basically the same only the form field and the regular expression which is used to validate the field will change.
I’m having a difficult time figuring out the quickest and easiest method to go about doing this.
Any pointers in the right direction would really be great, maybe even some keywords that I’m missing. I can only imagine this type of question has been covered before, I just don’t know what I’m searching for really.
I have done something similar using XML to generate controls at runtime
The easiest way i found was to create custom controls to allow easy validation.
I also collect details regarding the controls to be able to return the value of the fields to the webservice
Here is how i achive this
You could also add event handles to validate at a specific event(i.e blur)
Hope this helps
Sp