Re: Re: Re: TreeControl bug?
Quote:
Originally posted by Thresher
So can you think of a work-around for this? Because the TreeControl TVN_ONCLICK is called before EN_KILLFOCUS for the Edit box I'm getting an undeseriable result by mixing different TreControl data with old EditBox data.
What do you mean by old EditBox data? The data in an edit control doesn't depend on the EN_KILLFOCUS message being sent or not. Just use appropriate DDX member variables for your controls. When the tree control is clicked, call UpdateData(TRUE) and access the corresponding member variable to get the contents of the edit control. Besides that, you should check if TVN_ONCLICK is actually the message you want to handle for your case. For example, what happens when the user switches to the tree control by pressing the tab key? What if he uses the arrow keys to navigate the tree control? I suspect that TVN_SELCHANGING or TVN_SELCHANGED are probably more suited - but it really depends on your actual needs.