Treeview

Fredt
06-05-2003, 05:20 AM
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!

navet1ss
06-05-2003, 05:40 AM
The only way I see right off hand to identify multiple items of interest would be to use the checkboxes.

Fredt
06-05-2003, 06:08 AM
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.

Csharp
06-05-2003, 08:50 AM
try this.

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

Fredt
06-06-2003, 02:39 AM
try this.

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.

GraGra33
06-06-2003, 07:10 AM
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!

Fredt
06-08-2003, 03:48 AM
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!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum