#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Treeview

I have a treeview (version 6.0) embedded in a worksheet. After I add a node
to the structure, I wish I could have the newly added treenode highlighted
straight away so that the user could edit the label instantly, like what one
can do with Microsoft Outlook, say adding a new folder. Is there a way doing
so? Pls point me to the right direction. Thanks a lot.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Treeview

Hi

See if something like this works for you:

Private Sub Btn1_Click()
Dim Nodx As Node
Set Nodx = Me.Tvw1.Nodes.Add("Root", _
tvwChild, "N" & Tvw1.Nodes.Count + 1, "New node")
Nodx.EnsureVisible
Nodx.Selected = True
Tvw1.LabelEdit = tvwAutomatic
Tvw1.StartLabelEdit
Set Nodx = Nothing
End Sub

(I wrote this with VB6. Maybe the objects will need a different addressing
from Excel, but you obviously know how to do that part.)

HTH. Best wishes Harald


"Patrick Choi" skrev i melding
...
I have a treeview (version 6.0) embedded in a worksheet. After I add a

node
to the structure, I wish I could have the newly added treenode highlighted
straight away so that the user could edit the label instantly, like what

one
can do with Microsoft Outlook, say adding a new folder. Is there a way

doing
so? Pls point me to the right direction. Thanks a lot.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TreeView Object bach New Users to Excel 1 August 15th 05 02:51 PM
Treeview in excel Chris Excel Programming 0 July 1st 04 07:12 PM
How to Treeview in VBA kvenku[_9_] Excel Programming 1 May 27th 04 01:03 PM
TreeView marijan glavac[_2_] Excel Programming 2 April 30th 04 07:28 AM
Treeview Max Scott Excel Programming 2 October 3rd 03 02:00 PM


All times are GMT +1. The time now is 03:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"