List Box Point-to-Select (MouseMove)

I have a list box that shows files from my hard drive.  I'd really like to
have it select the item being pointed to as I move my mouse pointer over it.
I have coded this and it works fine unless the list is scrolled.  I need a
way to offset my list index to account for how far down the list has been
scrolled.

I can't find a list box property that will allow me to determine where a
scrolled list is positioned.  Something giving me the list index of the first
visible row would do the trick.  I haven't been able to find anything so far.

I've tried some VB code that uses the SendMessage API to extend the style of
the list box to do exactly what I'm after (point-to-select), but it doesn't
work.  I think I'm running into the fact that Access list box controlss don't
have .hWnd properties to identify them to the API.

Any clever ideas out there?

Another nice feature that depends on point-to-select capability is displaying
tool tips specific to a selected row.  See
http://www.codeguru.com/vb/controls/vb_listbox/article.php/c2767/

Thanks!

0
skeptic23
6/19/2007 12:57:06 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
782 Views

Similar Articles

[PageSpeed] 14

skeptic23 wrote:

>I have a list box that shows files from my hard drive.  I'd really like to
>have it select the item being pointed to as I move my mouse pointer over it.
>I have coded this and it works fine unless the list is scrolled.  I need a
>way to offset my list index to account for how far down the list has been
>scrolled.
>
>I can't find a list box property that will allow me to determine where a
>scrolled list is positioned.  Something giving me the list index of the first
>visible row would do the trick.  I haven't been able to find anything so far.
>
>I've tried some VB code that uses the SendMessage API to extend the style of
>the list box to do exactly what I'm after (point-to-select), but it doesn't
>work.  I think I'm running into the fact that Access list box controlss don't
>have .hWnd properties to identify them to the API.
>
>Any clever ideas out there?
>
>Another nice feature that depends on point-to-select capability is displaying
>tool tips specific to a selected row.  See
>http://www.codeguru.com/vb/controls/vb_listbox/article.php/c2767/


Your API idea is the way I have seen this kind of done.  A
key point is that the ONLY time you can get a hWnd for an
Access control is when it has the focus.

Scrounge around in Stephen Lebans' site for example code
that you might be able to adapt to your needs.  I think
these may be pertinate:
http://www.lebans.com/justicombo.htm
http://www.lebans.com/setgetsb.htm
http://www.lebans.com/tooltip.htm

-- 
Marsh
MVP [MS Access]
0
Marshall
6/19/2007 6:12:25 PM
Marshall...

BULLSEYE!  The tooltip code was exactly what I was looking for.

Thanks so much, and now that I see what the real solution entails, I'm glad I
didn't try to take my crude attempt any farther.  No API programmer here...
yet...

Thanks!
Millard

Marshall Barton wrote:
>>I have a list box that shows files from my hard drive.  I'd really like to
>>have it select the item being pointed to as I move my mouse pointer over it.
>[quoted text clipped - 16 lines]
>>tool tips specific to a selected row.  See
>>http://www.codeguru.com/vb/controls/vb_listbox/article.php/c2767/
>
>Your API idea is the way I have seen this kind of done.  A
>key point is that the ONLY time you can get a hWnd for an
>Access control is when it has the focus.
>
>Scrounge around in Stephen Lebans' site for example code
>that you might be able to adapt to your needs.  I think
>these may be pertinate:
>http://www.lebans.com/justicombo.htm
>http://www.lebans.com/setgetsb.htm
>http://www.lebans.com/tooltip.htm
>

-- 
Message posted via http://www.accessmonster.com

0
skeptic23
6/20/2007 12:10:45 AM
I know what you mean about API programming.  What little of
it I've done could not have been accomplished without
Stephen's web site.  Be sure to put it in your 
Favorites - Access folder along with the other invaluable
Access sites (too many to list, but there are a lot of links
to Related Sites on the Resource page at The Access Web
http://www.mvps.org/access/)
-- 
Marsh
MVP [MS Access]


skeptic23 via AccessMonster.com wrote:

>Marshall...
>
>BULLSEYE!  The tooltip code was exactly what I was looking for.
>
>Thanks so much, and now that I see what the real solution entails, I'm glad I
>didn't try to take my crude attempt any farther.  No API programmer here...
>yet...
>
>
>Marshall Barton wrote:
>>>I have a list box that shows files from my hard drive.  I'd really like to
>>>have it select the item being pointed to as I move my mouse pointer over it.
>>[quoted text clipped - 16 lines]
>>>tool tips specific to a selected row.  See
>>>http://www.codeguru.com/vb/controls/vb_listbox/article.php/c2767/
>>
>>Your API idea is the way I have seen this kind of done.  A
>>key point is that the ONLY time you can get a hWnd for an
>>Access control is when it has the focus.
>>
>>Scrounge around in Stephen Lebans' site for example code
>>that you might be able to adapt to your needs.  I think
>>these may be pertinate:
>>http://www.lebans.com/justicombo.htm
>>http://www.lebans.com/setgetsb.htm
>>http://www.lebans.com/tooltip.htm
>>

0
Marshall
6/20/2007 12:57:35 PM
Reply:

Similar Artilces:

Drop down box problem
Please can someone help me!!! I am trying to inset a drop down box int an excel spreadsheet but haven't got a clue whether I use a list box o a combo box. I want it to display first, second, third, fourth in th drop down menu so that the user can sleect one of these. The thing is don't know how to put the values in the box! Your help would be muc appreciated! :- -- Message posted from http://www.ExcelForum.com Hi use the Data / Validation - List option ... click in the cell where you want the drop down, choose Data / Validation from the menu, choose List, and in the source line ty...

update the same cell into another column forming a list on opening
hi there, i have made a spreadsheet to enter data and then view the resulting statistics that are generated, i have one cell that changes in value after entering the data, and i would like to keep a record of what values this cell has been, i was after a formula that would update that single cell's value into a column forming a list each time the spreadsheet was opened or the value in the cell changed, like a field perhaps, this would fill up the column with a list of results from which to generate more stats and a graph etc. any help would be great, thank you -- thank...

Cannot select objects
We enable the "Select Objects" feature (Home Tab > Find & Select), but can never select multiple activeX controls (checkboxes) by dragging the mouse. The selection extent (marquee) can be dragged around the objects, but it will not select them. The selection pane option is no better because we cannot drag over multiple selections, nor manually extend (SHIFT-Select) selectons, in the selection pane either. The only way we can make multiple selections is by CTRL-Selecting objects on the worksheet or in the selection pane. Any suggestions why we cannot drag-select our co...

Tick box how do i? plz
Hi Folks, I have a spreadsheet that I want to put a tick box coloumn into to show whether I need to reprocess an item. Can some kind person tell me how thank you. Mike Got it sorted thnx "Nevyn" wrote: > Hi Folks, > I have a spreadsheet that I want to put a tick box coloumn into to show > whether I need to reprocess an item. Can some kind person tell me how thank > you. > Mike ...

conversion file dialog box
Every time I open Outlook 2002, the file conversion dialog box opens along with Word and eventually an error message. Does anyone know how to turn this off? What file conversion dialog? Post the exact dialog that appears. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, frustrated asked: | Every time I open Outlook 2002, the file conversion | dialog box opens along ...

Check box problem
I want to include a check box in a form I have created. It appears that to make the box checkable by users, i.e. by clicking on it, I have to lock the table/form. However, doing this prevents anyone entering text on the others parts of the table/form. Is there any way to make the box checkable without rendering the rest of the form locked please? (One workaround is to double click the box and click on the Checked option. However, this is not really a very user friendly solution for what surely should be simple.) V For a form that includes check boxes, you must add text f...

create a drop down list with the source from a different workbook
Hi, I tried to create a drop down list (Data > Validation > List) with the source from a different work book (If you type the list in a different workbook, define a name with an external reference to the list.). I followed the instructions given in the Microsoft Online Assistant. Iam not able to create the same as iam a getting a message stating that "You may not use references to other worksheets or workbooks for Data validation criteria." Try Debra Dalgleish's web site on this subject: http://www.contextures.com/tiptech.html Scroll down to "D", and see ...

Scroll to specific list box entry
I am trying to scroll to a specific line entry in a multi-select list box in response to a user-input search criterion (in a separate text box) so that the desired record becomes visible to the user. I can locate the matching record and determine the line number, but I can't find a VBA method to scroll to reposition the record. My intent is to enable a user to enter the beginning character(s) to locate the section of entries that begin with the user search criterion. From that position, the user can then select the entries of choice. I will appreciate any help. Richard Here a...

Count unique names in a list
hi How do I count a list of names, some names appear more than once. I only want to count unique names. I use excel 2007 Thanks Cassie One way... =SUMPRODUCT((A2:A20<>"")/COUNTIF(A2:A20,A2:A20&"")) -- Biff Microsoft Excel MVP "Cassie" <Cassie@discussions.microsoft.com> wrote in message news:B610A13C-FAF8-46EF-A63C-AAE88EEFB89F@microsoft.com... > hi > How do I count a list of names, some names appear more than once. I only > want to count unique names. > I use excel 2007 > Thanks > Cassie For ...

Need quick way to build distribution list
Hi. I need to build a distribution list quickly which has as it's members people sending me emails (people not currently in my contacts). But the emails aren't coming from the individuals, they are coming from a form on my website. So - all the emails come from the same address (my web form) - all emails are formatted the same - all contain an email address for someone who filled out the form I'd like some kind of drag and drop or automated way to "dump" all those addressed into a list so I can reply to them en masse. Anyone know of a way to do this using ...

company split
Hi all, hoping to get some advice on this, the company i work for consists of two divisions who are effectively looking to split, and do there own thing. But initially will continue to share resources such as IT. Is it possible in exchange to allow them both to have there own email addresses such as name@company1 and name@company2 and to hide these so that relevant individuals only see the names of users relevent to there division/company in their address book. Effectively what i need to be able to do is run 2 seperate companies from one exchange box. bearing in mind that both compani...

Bring in list of accounts in the Quick Journal setup
when setting up a Quick Journal, allow for an option to bring in a range of accounts by any segment of an account. For example, all salary accounts, all postage accounts.. rather than selecting each one individually or using the Table Import ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree"...

Form with an unbound combo box.
I´m trying to create a database but I take some examples from Inside Out 2007 by Viescas.I create a tblTeams ( TeamID,TeamName) tblPlayers(PlayerID) and tblTeamPlayers(TeamID,TeamName,PlayerID). I create a form based on qryplayers and I need a combobox "unbound?" called TeamName based on qlkqTeams but when I try to open the combobox always shows the TeamID instead of TeamName. In the sample database "Contacts" from Viescas the CompanyName is display in the combobox CompanyID. I don´t really Know how this happen.Can anybody give me an idea of how this...

Import CSV from Open Dialog box Confirmation
Hi. I got my command button to bring up an open dialog box, where the user will select the CSV file to be imported. After the user finds the file to be imported, I want a MsgBox that asks the user to confirm that the specific file be imported. For example, the user selects SCO.csv to import and clicks a okay. A Msgbox should popup "Are you sure you want to import SCO.csv" with a Yes button and a No button. I'm not sure if this is even possible, but if so could someone please guide me. If they click No, then the process should just cancel. Assume strFileName is the variable wit...

updating and underlying table field with a combo box selection
I want to use an ID value from a combo box on a subform to update the same ID value in the form's underlying table. My main form is: frm_Street_Joiner_Main My Subform is: frm_Street_Joiner_Sub My Subform table is: tbl_Street_Joiner My Mainform is: frm_Street_Joiner_Main The combo box on my subform is called: StreetName, with a column count of two but the bound column is the actual street name. SELECT QRY_Street_Names_Joiner_Master.Street_Names, QRY_Street_Names_Joiner_Master.StreetNameID FROM QRY_Street_Names_Joiner_Master ORDER BY QRY_Street_Names_Joiner_Master.Street_Names, QR...

Randomly selecting items from a list given their statistical likelihood #5
:) SOLUTION: In case anyone in the future happens to stumble on to this post in th future with similar issues, here's what I came up with: where a6:a129 are the product names c6:c129 are the relative frequency selected 10,000 times in column k. from which I added 6 columns of rand() along side k and had a ro that selected the highest in each column and gave the correspondin product name which was then value pasted, placed on the side repeatedl for a random sample. Sub UsePercentDistribution() ' ' Macro1 Macro ' Macro recorded 9/13/2004 by Douglas ' Dim Stylecount Dim ...

Exporting Exchange mailbox List
I need to get a full list of all users mailboxes sizes in exchange, i did that by entering each store ,opened mailboxes folder and export the list that appears, the problem that the total number of mailboxes in stores is less than the users in active directory which have a mailbox, can any body tell my why this is happining, and if there is a way to export all users names with their mailbox sizes for statistical reports without the need to open each store. The farm we have are windows 2003 active directory, no SP1 installed, and i have Exchange 2003 with SP1. Hi, It is possible for a...

Data Validation Lists
I have been searching the web all day, and I am not sure how to approach this problem. Here is a basic worksheet: ID Name Serial # 1 Joe ck9033n2389d 2 Joe 349-283fjrjh55 3 Bob c90320j34n5kjdf 4 Joe kgho95injhs 5 Bob 2353gdf745 Step 1: I have a drop down list with only one instance of each of the "Name" variable. Step 2: Upon selecting that name, I would like another drop down box with all the serial numbers associated with that person. Step 3: Then, based on the serial number, display stats in the same row for that i...

Select ID,Data FROM [Data$]"
I'm going thru C# code that connects to an excel object. I've never seen a slq construct like this. Would someone please decipher the "[Data$]" part? Thank you. "Select ID,Data FROM [Data$]" (used in a constructor like: new OleDbDataAdapter(query, connection)) On May 9, 9:28=A0am, cate <catebekens...@yahoo.com> wrote: > I'm going thru C# code that =A0connects to an excel object. =A0I've never > seen a slq construct like this. =A0Would someone please decipher the > "[Data$]" part? =A0Thank you. > > "Select...

Filename list into Excel
Hi, I would welcome help with the following problem: I need to generate a spreadsheet that contains the filename, date created and date modified (at least) for all files in a folder. I'm not interested in the content of theses files, I just need the file properties in a spreadsheet. Any suggestions as to how to achieve this will be greatly appreciated. Regards, Fred I do this all the time Go to DOS prompt, Dir full-path\*.*>c:\filelist.txt Use Excel to open this file Text to column -- Regards PY & Associates "Fred" <Fred@discussions.microsoft.com> wrote ...

IE auto complete list
does nyone know how to delete auto complete information of IE or where it is stored? I am writing a small mfc app and need to clear the autocomplete information. ...

public folders and global address list
Hi Folks, I have some calendars set up in my public folders for scheduling purposes representing certain conference rooms. I would like to place these calendars in my global address list so that when inviting to meetings, a meeting will be added to that room's calendar (as opposed to scheduling a meeting for people and room separately). Does anyone know how I can accomplish this? Thanks ahead of time! Matt Public Folder calendars don't make good resource calendars. The better option would be to create dedicated resource user accounts and mailboxes (i.e. user called Conference ...

Option Buttons in Group Box
I have two group boxes with two option buttons in each(from the Forms Tool bar) Is there any way to make the group boxes invisible. I would like to have only the option buttons showing on the worksheet. Set the BorderColor to the same color as the BackColor, and change the SpecialEffect setting to 0 (fmSpecialEffectFlat). -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "JAMES T." <sylvester1501@peoplepc.com> wrote in message news:1111518141.249157.66540@z14g2000cwz.googlegroups.com... >I have two group boxes with t...

How can I set up the random selection of a cell from within a ran.
I want Excel to randomly select one cell from a range of cells, but is it possible? This would be the equivalent of drawing one slip of paper from several hundred. An uncomplicated way to do this is to simply add a column filled with the RAND() function next to your column of choices. Select both columns, and sort on the Rand() column. Pick the one at the top, or bottom, as your random selection. A little more complicated procedure would be to use a formula, referring to this combination of Rand() and your list, and let this formula randomly pick an item. Place your list in an "out o...

font list
Is there a way to get a list of all the fonts used in a document? On Jun 1, 6:25=A0pm, "Peter T. Daniels" <gramma...@verizon.net> wrote: > Is there a way to get a list of all the fonts used in a document? Did this get lost in the changeover? The transition into forums doesn't seem to be finished yet. -- Stefan Blom Microsoft Word MVP (Message posted via msnews.microsoft.com) "Peter T. Daniels" <grammatim@verizon.net> wrote in message news:3a075bf7-0106-458f-8390-dae4a97668fb@c11g2000vbe.googlegroups.com... On Jun 1, 6:25 pm, "...