I have a dynamically created (runtime creation) textbox whose name is available as a string.What i want to do is access this textbox like we do as normal textboxes .Can any one tell me how to cast it as textbox or any other solution
I have a dynamically created (runtime creation) textbox whose name is available as a
Share
In addition to Iordan’s answer, if you don’t know exactly where on your form the textbox is, then this extension method should help alot. Note,
Form‘s inherit fromControlsomewhere down the track too, so you can call it from that, or any control on your form.If this still isn’t flexible enough for you, then you can iterate over
System.Windows.Forms.Application.OpenForms