Solved

Listview

Posted on 1998-07-02
6
195 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
[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
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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
Course of the Month8 days, 12 hours left to enroll

615 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