Drstein99 Posted October 14, 2003 Posted October 14, 2003 I can create a textbox and assign the control at runtime, and retrieve data with no problem. Is there a way I can assign one of my functions in my code at designtime as the event handler for the new control at runtime? In other words, I want to create a data validation keypress event, at designtime, and at runtime create a textbox and assign it's keypress event to the one in the module. Please help, thanks. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
*Experts* mutant Posted October 14, 2003 *Experts* Posted October 14, 2003 Look into the AddHandler keyword. It will add a handler for an event for a control at runtime. AddHandler object.event, AddressOf methodtobethehandler Quote
Drstein99 Posted October 14, 2003 Author Posted October 14, 2003 I checked it out and the vb.net help was descriptive enough to help me solve my issue (surprisingly). Thanks for the point in the right direction, it solved my issue - case closed! Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
tanmoy Posted March 11, 2006 Posted March 11, 2006 hello sir i am tanmoy.i have created a textbox in runtime.now i want to assign some events from this runtime controll.like retrive the value of the textbox or click event.please tell me how can i do this as quick as possible.thank you.my email id is:sadhuambarish2005@yahoo.co.in Quote
Cags Posted March 11, 2006 Posted March 11, 2006 Retrieving the value of a textbox would assumbably be done using the .Text property which is not an event but a property. Adding a click event is reasonably simple, and there is already an example of how this is achieved in VB.Net AddHandler object.event, AddressOf methodtobethehandler Quote Anybody looking for a graduate programmer (Midlands, England)?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.