Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Treeview


Reply
 
Thread Tools Display Modes
  #1  
Old 06-05-2003, 05:20 AM
Fredt Fredt is offline
Regular
 
Join Date: Jun 2003
Location: Holland
Posts: 48
Default Treeview


Hello all,

Does sombody now how to multiselect in a treeview? By a listview i can set the property multiselect= true, but i can't find a property for a treeview.

I use common controls (SP6).

Thanks!
Reply With Quote
  #2  
Old 06-05-2003, 05:40 AM
navet1ss navet1ss is offline
Junior Contributor
 
Join Date: Mar 2003
Posts: 299
Default

The only way I see right off hand to identify multiple items of interest would be to use the checkboxes.
__________________
NAVigation Electronics Technician 1st class Submarine Service
--------------------in case you were wondering--------------------
Reply With Quote
  #3  
Old 06-05-2003, 06:08 AM
Fredt Fredt is offline
Regular
 
Join Date: Jun 2003
Location: Holland
Posts: 48
Thumbs up treeview

Quote:
Originally Posted by navet1ss
The only way I see right off hand to identify multiple items of interest would be to use the checkboxes.




Thanks for the fast reply!!

I'll already started on that, but i hoped that maybe there was a posibility. Maybe in the way of highlighting.
Reply With Quote
  #4  
Old 06-05-2003, 08:50 AM
Csharp's Avatar
Csharp Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

try this.
Code:
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const TVS_FULLROWSELECT As Long = &H1000
Private Const GWL_STYLE As Long = -16

Private Sub Command1_Click()
Dim lng As Long
lng = GetWindowLong(TreeView1.hwnd, GWL_STYLE)
lng = lng Or TVS_FULLROWSELECT
SetWindowLong TreeView1.hwnd, GWL_STYLE, lng
End Sub
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
  #5  
Old 06-06-2003, 02:39 AM
Fredt Fredt is offline
Regular
 
Join Date: Jun 2003
Location: Holland
Posts: 48
Default treeview

Quote:
Originally Posted by dynamic_sysop
try this.
Code:
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const TVS_FULLROWSELECT As Long = &H1000
Private Const GWL_STYLE As Long = -16

Private Sub Command1_Click()
Dim lng As Long
lng = GetWindowLong(TreeView1.hwnd, GWL_STYLE)
lng = lng Or TVS_FULLROWSELECT
SetWindowLong TreeView1.hwnd, GWL_STYLE, lng
End Sub



I'll have try't, but nothing seem to happen. I'll think it only sets the property fullrowselect = true. That means that a row completely will be highlighted.

But it was a try. Thanks!!

I use now checking the rows. It's fine, but a litle bit anoying.
Reply With Quote
  #6  
Old 06-06-2003, 07:10 AM
GraGra33 GraGra33 is offline
Newcomer
 
Join Date: May 2003
Location: Australia
Posts: 1
Default

Quote:
Originally Posted by Fredt
Hello all,

Does sombody now how to multiselect in a treeview? By a listview i can set the property multiselect= true, but i can't find a property for a treeview.

I use common controls (SP6).

Thanks!



Multiselect is not a normal function of the TreeView control. However it can be done but requires custom implementation.

I have spent the time to implement this feature. It's quite a bit of code. I've also implemented Disabled Nodes that will also work with the MultiSelect feature.

Source code for wrapper class/DLL, 8 x Tutorials + 1 x Demo application, & Html Help are all included in the attached zip.

Alot of other questions should also be answered with regards to the TreeView control. Make sure that you look at the Read Me First in the help section before using it.

Hope this helps!

Last edited by GraGra33; 06-06-2003 at 09:57 AM.
Reply With Quote
  #7  
Old 06-08-2003, 03:48 AM
Fredt Fredt is offline
Regular
 
Join Date: Jun 2003
Location: Holland
Posts: 48
Default treeview attached zip

Quote:
Originally Posted by GraGra33
Quote:
Originally Posted by Fredt
Hello all,

Does sombody now how to multiselect in a treeview? By a listview i can set the property multiselect= true, but i can't find a property for a treeview.

I use common controls (SP6).

Thanks!



Multiselect is not a normal function of the TreeView control. However it can be done but requires custom implementation.

I have spent the time to implement this feature. It's quite a bit of code. I've also implemented Disabled Nodes that will also work with the MultiSelect feature.

Source code for wrapper class/DLL, 8 x Tutorials + 1 x Demo application, & Html Help are all included in the attached zip.

Alot of other questions should also be answered with regards to the TreeView control. Make sure that you look at the Read Me First in the help section before using it.

Hope this helps!



Thanks for your help! I only have one suggestion, where is your attached zip? Or can I download it somewhere?

Again thanks!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hooking or Subclassing a Treeview? LiquidPenguin General 4 04-24-2003 11:41 AM
TreeView Help Needed oceanic99 General 4 03-17-2003 09:28 AM
Treeview Help ! Megazoid General 0 11-30-2002 04:06 PM
TreeView Subclassing cpukiller Interface and Graphics 14 11-06-2002 07:26 AM
TreeView - want to highlight part of treeView mattrade General 4 09-09-2002 03:04 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->