I don't see how that will help. Changing the text property programatically doesn't fire the OnChange event. It requires a manual selection in the combobox.
Thanks anyway, Ross. ----- Original Message ----- From: "Arjang Assadi" <[EMAIL PROTECTED]> To: "Borland's Delphi Discussion List" <[email protected]> Sent: Thursday, January 25, 2007 4:11 PM Subject: Re: Delay setting Text Property 1)detach the on changeEven 2)Change Text 3)re attach the on change event On 1/25/07, Ross Levis <[EMAIL PROTECTED]> wrote: > > I want to change the Text property of a ComboBox inside the OnChange > event. Setting it directly doesn't work presumeably because the > OnChange event occurs before the change occurs rather than after. > > So I decided the best way to do this would be to send the WM_SETTEXT > message using PostMessage with a global variable storing the text... > > PostMessage(ComboBox1.Handle,WM_SETTEXT,0,Integer(pChar(GlobalString))); > > But this doesn't work either. I read somewhere that Windows doesn't > allow PostMessage to work with string pointers because it's likely the > string address on the stack is temporary and will not exist after > PostMessage has been sent. This may be correct in most cases but with > a > global string, the address of the string will be constant, so it would > work. > > SendMessage works with string pointers, but SendMessage waits until > the > message has been delivered before the procedure continues execution, > so > that defeats my purpose. > > Is there anyway to fool Windows into sending a WM_SETTEXT message > without waiting. Or do I have to muck about with a timer or send my > own > user message to get this to work? > > Thanks, > Ross. > > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

