hog Posted June 29, 2003 Posted June 29, 2003 I have code in a textboxes textchanged event which obviously fires when the user changes the text in the textbox. Question is if I change the textboxes text from code elsewhere during runtime, why doesn't the textchanged event fire? Is there a way to force it to fire? Quote My website
hog Posted June 29, 2003 Author Posted June 29, 2003 Mmm correct me if I'm wrong but is it ok to call a textbox textchanged event manually? If so I have just sorted it:):) Quote My website
*Experts* Nerseus Posted June 30, 2003 *Experts* Posted June 30, 2003 You can manually call any event handler as they're just functions that happen to get called by the event handler (through a delegate). The "special" work is done by the event, not the function that gets called. Many people would rather move the code out from the TextChanged event into a function, say UpdateFirstName (if the textbox is txtFirstName for instance). Then call UpdateFirstName() from the event handler (TextChanged event) and from wherever else you're changing the textbox's value manually. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
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.