How to set control focus

T

Tee

Hi,

In my C# application i have a treeview control and listview control, the
treeview is on the left side of the from and the listview is on the right.
When i click on an item in treeview i got code to force the listview to
selected the appropriate item and set focus on the listview, but the focus
never work it always stay on the treeview control.

Here my sample code

private void Treeview1_NodeClick(..)
{
listview1.items[0].selected = true;
listview1.focus();
}

Can anyone see what is wrong with my codes.... i really really want the
listview to have the focus when the user had clicked on any item in the
treeview. The reason because i have a lot of comment from my users said
that the listview should have the focus so that they can do other
performance without having to click on the listview first.

Any sample codes would be appreciative, looking forward hearing from you
all.

Regards
 
B

Brannon

Are you calling the base.treeviewNodeClick after the focus command?
Also, some users have dumb requests. You should ignore those requests
and stick with standards. Let the user drive the focus manually. You
can set the selection and the tab order to help them.
 

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