General design of WPF

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

In WPF, I would like to create similar functionality as Windows Explorer has
for renaming folders. (If you press F2 over selected tree view item is
displayed textbox which contains name of folder which can be edited).
In WPF I can do it using TreeView control but I do not know how to position
correctly textbox over selected TreeViewItem after clicking rename. I do not
know how to find out screen position of selected item in TreeView.
But also I am not sure if my approach is correct for WPF based application.

Thanks for any suggestions how to implement similar functionality :-).

John
 
Theres a few ways to do it.. I think.

You could change the content (or header?) of the treeviewitem from a
TextBlock or whatever to a TextBox (or have one there a toggle its
visibility between Collapsed and visible).

HTH
 
Hi John,

Sorry for late reply. Here's an working example which uses style to achieve
this:

http://blogs.microsoft.co.il/blogs/tamir/archive/2007/05/20/Create-editable-
TreeViewItem-using-styles.aspx

Please let me know if you have any other questions.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi John,

I'm writing to check the status of this post. Please feel free to let me
know if there's anything else I can help. Thanks.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top