ListView with columns request

Started by David Martin, May 20, 2004, 05:35:04 PM

Previous topic - Next topic

David Martin

Paul,

When you use a ListView with columns, only the item in the first column is selectable & highlighted.  The below code can overcome this shortcoming ... thought you might be able to implement it in Window Styles if LVS_REPORT is chosen.  This code came off from MSDN.

tmpResult& = SendMessage(HWND_FORM1_LISTVIEW1, %LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
tmpResult& = tmpResult& Or %LVS_EX_FULLROWSELECT
SendMessage(HWND_FORM1_LISTVIEW1, %LVM_SETEXTENDEDLISTVIEWSTYLE, 0, ByVal tmpResult&)

Thanks,

David

TechSupport

Thanks David,

I use the same code in FireFly itself. For example, there is a ListView in the "Open" dialog that displays a list of Most Recently Used projects. That has full row select as well.

As you probably already know, you can also insert your code into the WM_CREATE message and it should work.

David Martin

Yeah, that's what I did.  Just thought I would mention this.

David

TechSupport

Hi David,

I built upon your suggestion and added all 17 extended ListView styles to the FireFly PropertyList. Now it is extremely easy to set any of those styles.

michael puckett


TechSupport

Just for clarification, this change will be in the next update (version 1.04), which I hope to have out very soon.

David Martin

Paul,

I downloaded and installed 1.04 but do not see a %LVS_EX_FULLROWSELECT ( or similar ) option for for a ListView control Window Style.

What I am missing?

Thanks,

David

TechSupport

Hi David,

You will need to delete your existing control and add a new ListView control. Simply give your new control the same name that you gave your old control and you should be in business.

David Martin

Tried that ... and tried adding a ListView to a completely different form.  But still do not see a LVS_EX_FULLROWSELECT ( or similar ) option.

TechSupport

Sorry David, I wasn't very clear.  :oops:

All of the extended LVS styles have been given separate properties in the PropertyList. Therefore, they are not contained in the WindowStyles.

There should be a separate property simply called "FullRowSelect". Set that property to "True". That should do the trick.

Please let me know if it works or does not work.

David Martin

Man, taking three days off must have gotten to me.  I looked for that originally but did not think to after adding a new ListView control ... works fine.

Thanks,

David