-
Re: Listview
You need to set the ZOrder of the textbox/other control that you want to display on top of the Grid,
eg.
Text1.ZOrder
- as for the Multiple Selection - I had to manually track each Click on the grid and store the selected row in an array/collection. You also have to remember to check the keystate when the user clicks the mouse to make sure you follow standard windows 'rules' for multiple selection (ie. Shift + select, CTRL + select etc).
The repainting is slightly more tricky as you need to turn off all highlighting in the grid and paint it yourself - the CellBackColor property allows you to make the rows appear as selected.
It was a lot of work - make sure you really have the time to implement all of this before you jump straight in.
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
Re: Listview
Thank you a lot!
Is it more easy to do dbl-click in a ListView and not in MSFLEXGrid
-
Re: Listview
Can i do the same with a ListView : to update the height of the column header to occupy 2 rows and then to put the controls on the column header at the bottom of the title. Do you know how to change the height of the ListView's columnheader?
-
Re: Listview
Hi,
I too am trying for the same :-), increase the height of Column header. It doesn't seem possible yet.
If you care for details:
Listview header is a control by itself - Header Control of Common Controls set, that does this default processing of drag etc. Each item of it has a structure HD_ITEM. You can fill this structure and send a message to header so that it takes appropriate action.
Like:
SendMessage hWndHdr, HDM_SETITEM, 1, tmpHDItem
It is defined like this:
public Type HD_ITEM
mask as Long
cxy as Long
pszText as Long
hbm as Long 'HBITMAP hbm;
cchTextMax as Long 'int cchTextMax;
fmt as Long 'int fmt;
lParam as Long 'LPARAM lParam;
iImage as Long 'int iImage; // index of bitmap in ImageList
iOrder as Long 'int iOrder; // where to draw this item
End Type
There is only one member Cxy and the mask can take these two values (along with others too)
when you want to set the width & height.
public Const HDI_WIDTH = &H1
public Const HDI_HEIGHT = HDI_WIDTH
In the CommCtrl.h file the height constant is set to Width!!. So all that you can do is only change the width by that HD_SETITEM message. I tried and it works only for width.
Right now i am looking into MSDN. Will let you know if something comes up.
Ravi Kiran