BBC BASIC for Windows
Programming >> BBC BASIC language >> ListView controls http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1290410494 ListView controls
Post by Matt 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
Re: ListView controls
Post by admin on Nov 22nd, 2010, 08:17am
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 .
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":
Richard.
Re: ListView controls
Post by Matt on Nov 23rd, 2010, 05:59am
Thanks Richard.
It does exactly what it says on the tin.
Matt
Re: ListView controls
Post by Matt 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.)
Re: ListView controls
Post by admin on Nov 27th, 2010, 08:45am
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).