Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Listview

Posted on 1998-07-02
6
Medium Priority
?
198 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 200 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
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!

 
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…
Suggested Courses

670 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