Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help:Make the 1st col of ListView a TreeView?

Posted on 1998-10-09
3
Medium Priority
?
256 Views
Last Modified: 2010-04-30
I'm trying to simulate a message board similar to that used in the Outlook Express newsreader which has a ListView control with the first column appearing in a TreeView format. Is there a control that does this automatically or is is done manually? Either way, could someone please let
me know where to find the control or how to add the tree structure to the first column?
Any help would be greatly appreciated.
Shi Jun
0
Comment
Question by:shijun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:TheAnswerMan
ID: 1439168
Send me a screen shot of what you are talking about..
Myxlplick@msn.com
0
 

Author Comment

by:shijun
ID: 1439170
Dear hanzala,
Thank you but I think you may misunderstand or minimize this problem. You can use Outlook Express and look what the news looks like. And the tree view can displayed in any position, as well as in 1st col.If I follow you idea I think I should combine a tree view and some listviews. Thank you any way. Shi Jun

0
 
LVL 15

Accepted Solution

by:
ameba earned 300 total points
ID: 1439172
' declarations, in module
Public Type LVITEM
    mask As Long
    iItem As Long
    isubitem As Long
    State As Long
    stateMask As Long
    pszText As String
    cchTextMax As Long
    iImage As Long
    lParam As Long
    iIndent As Long
End Type
Public Const LVM_SETITEM = (LVM_FIRST + 6)
Public Const LVIF_INDENT = &H10&

' in form
' add listview, two columns, and add some items
' in debug window (or commandbutton) try:
' setindent(2,1)
Private Sub SetIndent(ByVal lIndex As Long, ByVal lIndent As Long)
    ' lIndex is 1-based; just pass the ListItem's .Index property
    ' lIndent is the amount of indentation desired; the unit of
    '         measurement is the width of the list item's image.
    Dim LVI As LVITEM
    Dim lRet As Long
    With LVI
       .iItem = lIndex - 1 ' winapi index is 0 based, VB is 1 based
       .mask = LVIF_INDENT
       .iIndent = lIndent
    End With
    lRet = SendMessage(ListView1.hwnd, LVM_SETITEM, 0, LVI)
End Sub


Is this what you want?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question