+ Reply to Thread
Results 1 to 1 of 1

ListView Control / Drag&Drop / msghook

  1. #1
    Registered User
    Join Date
    01-06-2011
    Location
    Paris
    MS-Off Ver
    Excel 07/10
    Posts
    5

    ListView Control / Drag&Drop / msghook

    Hello,

    I'm trying to solve the following problem using a listview:

    I have a list of items with a state for each (say installed/not installed). The user must be able to see the state of each item in the list (I use the checkbox property). When the user selects one item he gets (among others) the option of intalling/not installing.

    I used at first a simple Lixtbox, but the highlighting of a checked item is confusing the simple selection of an item (in other words, it's hard for the user to understand what the list does because the highlighting of checked items is stronger than the highlighting of a selected item). Since I could read everywhere that you can't change that behavior in a listbox, I moved to a ListView control.

    Now what I want to do is prevent all the extra functions of the listview (I don't want drag&drop, sorting...). I could find some code (http://www.devx.com/vb2themax/Tip/18444) to do that, but it fails at subclassing my form :

    FormHook.StartSubclass Me gives a runtime error 438.

    Could it be that this MsgHook class is not vba compatible? If that's not the case, any hint on how why it's not working?

    EDIT : actually, I managed to get some progress. The form (represented by Me) didn't expose its handle. So I worked around with FindWindow to directly supply the handle. Now the issue I have is that the window message I expected to be thrown as indicated in the code I found isn't... I did a bit of spying on the messages, but there doesn't seem to be any drag & drop related message at any time. I could identify a click and a selected event, but nothing else...

    Thanks in advance
    Last edited by gooopil; 04-10-2011 at 03:06 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1