Treeview problem

J

Jan Pavel

Hi,

I have a form with treeview and some other controls. I want to change focus
to some other control after user selects a node in treeview. I've handled
AfterSelect event to change focus to another control.
In case that user scrolls within a treeview using a keyboard, focus is
changed after selection, but when user selects some node with mouseclick
focus is not changed (it's left on treeview control).
Any idea how to solve this.

Thanks,
JP
 
Y

Ying-Shen Yu[MSFT]

Hi Jan,

From your description, my understanding now is
you want to swtich focus to another control (e.g. textbox) if you select a
certain tree node.
Your problem is, the Focus method does not work when you select the node by
mouse.

Based on my experience, I suspect the problem is caused by the order of the
underlying win32 message. You may use
//delegate bool BoolMethodInvoker();
BeginInvoke(new BoolMethodInvoker(textBox1.Focus));
instead of calling the Focus method directly.

Does it resolve your problem?
Please feel free to reply this thread if you still have problem on this
issue.


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top