PC Review


Reply
Thread Tools Rate Thread

TreeView Image List

 
 
=?Utf-8?B?bWFyaw==?=
Guest
Posts: n/a
 
      12th May 2005
Hi.

I'm basically new to TreeView, though I have tried it before, a long time ago.

I found a short example about adding nodes, referencing them to parents,
etc...

I see that you can add images to the nodes, but in order to do it, you need
to first have an imagelist associated with the treeview.

Which in turn means that you have to instantiated an image list, and
populated it with images.

There's the question... how do I work with an image list and images... I
couldn't seem to find it in the available controls, though they are both
there for dimensioning in the code.

Thanks for any help with this.
 
Reply With Quote
 
 
 
 
Robert Bruce
Guest
Posts: n/a
 
      12th May 2005
Roedd <<mark>> wedi ysgrifennu:


> There's the question... how do I work with an image list and
> images... I couldn't seem to find it in the available controls,
> though they are both there for dimensioning in the code.
>


Right-click on your controls toolbox to add a new control. From the list,
pick Microsoft ImageList (might be version 5 or 6 depending on which version
of VB you have installed). You can then add this control to your form.
Select the control once it is on your form's surface and set its properties
(including adding images) via the (Custom)[...] section of the properties
window.

Once you have added some images, you will find that you can't bind your
treeview to your imagelist at design time. I suspect that this is because
the two controls were not designed to be used with MSForms (and/or vice
versa). So, you'll have to bind at run time -

Private Sub UserForm_Initialize()
Set Me.TreeView1.ImageList = Me.ImageList1
Me.TreeView1.Nodes.Add , , , "My Node", 1, 2
Me.TreeView1.Nodes.Add , , , "My Other Node", 1, 2
'etc...
End Sub

You should be aware that to use this control in Office (except for Access)
you will need a design time licence for every machine it runs on. In other
words, you are not allowed to distribute Excel apps built with the treeview
and/or the imageview control.

--
Rob

http://www.asta51.dsl.pipex.com/webcam/

This message is copyright Robert Bruce and intended
for distribution only via NNTP.
Dissemination via third party Web forums with the
exception of Google Groups and Microsoft Communities
is strictly prohibited and may result in legal action.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?bWFyaw==?=
Guest
Posts: n/a
 
      12th May 2005
> You should be aware that to use this control in Office (except for Access)
> you will need a design time licence for every machine it runs on. In other
> words, you are not allowed to distribute Excel apps built with the treeview
> and/or the imageview control.




Thanks for telling me about that.

I use two machines here at work... one has Visual Basic 6, and the other
does not. The one that does not have VB6 does have MS Access 2000. Is that
why the treeview and imagelist controls are available on the machine without
VB?

Question... how would one be supposed to know that distributing Excel apps
with the treeview and imagelist is inappropriate, when it is available and
works from Excel, without any warnings about illegality? I didn't know.
(and haven't done it yet).

Mark



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recreate a >>C# WinForms<< TreeView "state" -after- treeview rebuild ?? Any TreeView GODS out there ?? frostbb Microsoft C# .NET 6 18th Aug 2008 05:08 PM
Generate treeview in server manipulate treeview in client side Ravi Microsoft Dot NET 0 2nd Sep 2004 04:00 PM
PLEASE: Treeview Variable into TreeView... Frank Uray Microsoft Dot NET Framework Forms 3 18th Oct 2003 07:49 PM
Treeview: Node.LastNode only works at end of treeview Dean Slindee Microsoft VB .NET 1 29th Sep 2003 02:51 PM
Re: TreeView, TreeView.HideSelection=false, Window.Minimize NotYetaNurd Microsoft Dot NET Framework Forms 2 30th Jun 2003 06:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:32 AM.