Solved

Listview

Posted on 1998-07-02
6
187 Views
Last Modified: 2010-05-03
1.) Is there a way that the whole line becomes selected when I select a row in report mode ?
     Only the first column items get selected, not the subitems.

2.) Is there a way to use different colors for different rows ?

 
0
Comment
Question by:tstrob
  • 3
  • 3
6 Comments
 
LVL 1

Accepted Solution

by:
Geffl earned 50 total points
ID: 1464775
To select the entire row you just have to make a simple API call:
Declaration:
Public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" _
       (ByVal hwnd As Long, _
       ByVal Msg As Long, _
       ByVal wParam As Long, _
       ByVal lParam As Long) As Long
       Public Const FIRSTADR = &H1000
       Public Const SETEXTLVSTYLE = FIRSTADR + 54
       Public Const GETEXTLVSTYLE = FIRSTADR + 55
       Public Const FULLROWSEL = &H20
Then use as follows:
       Dim Style As Long
       Dim x As Long
       'check Style
       Style = SendMessageLong(ListView.hwnd, GETEXTLVSTYLE, 0&, 0&)
       
       'to remove the FullRowSelection:
       Style = Style Xor FULLROWSEL
       'to set the FullRowSelection
       Style = Style Or FULLROWSEL
       'To apply just call
       r = SendMessageLong(ListView.hwnd, SETEXTLVSTYLE, 0&, Style)
Have fun
0
 
LVL 1

Author Comment

by:tstrob
ID: 1464776
Geffl,

thank you. This works.
Do you (or someone else) has an idea for the colors ?
0
 
LVL 1

Expert Comment

by:Geffl
ID: 1464777
I don´t know how to set different colors. But if it´s enough you can set Gridlines in the same way. Just Or with &H1 , Xor with &H1 (Define a global const for &H1: EXTLVGRID)
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:tstrob
ID: 1464778
Geffl,

thank you. This works.
Do you (or someone else) has an idea for the colors ?
0
 
LVL 1

Author Comment

by:tstrob
ID: 1464779
Geffl,

is there also a way to forbid the user to resize the columnheaders ?

tnx
0
 
LVL 1

Expert Comment

by:Geffl
ID: 1464780
I don´t think so. For such things it would be better to use a third party grid control.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now