Author |
Topic: ListView controls (Read 648 times) |
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
ListView controls
« Thread started on: Nov 22nd, 2010, 06:21am » |
|
The program I'm writing uses a List View. The font, however, is a little too small, but try as I might, I cannot find a way to increase itfrom within the program . Any help, please?
Matt
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: ListView controls
« Reply #1 on: Nov 22nd, 2010, 08:17am » |
|
on Nov 22nd, 2010, 06:21am, Matt wrote:The program I'm writing uses a List View. The font, however, is a little too small, but try as I might, I cannot find a way to increase it from within the program . |
|
Have you tried the method described on the Wiki:
http://bb4w.wikispaces.com/Changing+the+font+of+a+control
According to MSDN it should work: "When you create a list-view control, you can also send it a WM_SETFONT message to set the font to be used for the text. You should send this message before inserting any items":
http://msdn.microsoft.com/en-us/library/bb774736.aspx
If you find that it doesn't work, ask again.
Richard.
|
|
Logged
|
|
|
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Re: ListView controls
« Reply #2 on: Nov 23rd, 2010, 05:59am » |
|
Thanks Richard.
It does exactly what it says on the tin.
Matt
|
|
Logged
|
|
|
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Re: ListView controls
« Reply #3 on: Nov 27th, 2010, 05:43am » |
|
I'm getting myself in a right muddle here, bogging myself down with window controls.
I've got a columned list view and I want to select a cell with the mouse, recognise which cell it is (i.e. which row and which column), right click and select an action from the context menu. I've spent two days rumaging around msdn, but all I'm doing is confusing myself.
Help, please.
Matt
PS, how can I click anywhere on a row and have the whole row highlighted rather than just the fist column? (This is not important, just wondering.)
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: ListView controls
« Reply #4 on: Nov 27th, 2010, 08:45am » |
|
on Nov 27th, 2010, 05:43am, Matt wrote:I've got a columned list view and I want to select a cell with the mouse, recognise which cell it is (i.e. which row and which column), right click and select an action from the context menu. |
|
The first thing to note is that in a regular 'columned' (LVS_REPORT) List View you can only select items (rows), not cells. To discover which item(s) is/are selected you can iterate through all the items and test the LVIS_SELECTED flag in each one. n.b. if you want to disable the ability to select multiple items, use the LVS_SINGLESEL style.
To respond to a right-click you will need to intercept the WM_NOTIFY message carrying the NM_RCLICK notification. This can only be done using assembly language so is an advanced topic!
Quote:PS, how can I click anywhere on a row and have the whole row highlighted rather than just the fist column? |
|
Set the LVS_EX_FULLROWSELECT extended style (LVM_SETEXTENDEDLISTVIEWSTYLE message).
Richard.
|
|
Logged
|
|
|
|
|