473,378 Members | 1,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Deriving Combobox items indexes

To anyone who might be able to help.

I'm trying to derive the index of any random item in a populated combobox
dropdownlist when the mousepointer is over the item. Seems to me it should
be possible since the item "highlights" when the mouse passes over the
different items listed, but the end user hasn't yet "clicked/selected" any
specific item. I know it can be done with a listbox. Basically looking for
the LB_ITEMFROMPOINT equivalent for Comboboxes. Does anyone have any idea
how to accomplish this with a combobox? Please help.
Sep 22 '06 #1
4 1219
Easton,

Any reason that you want to do this, it sound for me forever stupid that
people want to confrontate users with non standard behaviour. Something from
the 80's in the previous century.

Cor

"Easton" <Ea****@discussions.microsoft.comschreef in bericht
news:52**********************************@microsof t.com...
To anyone who might be able to help.

I'm trying to derive the index of any random item in a populated combobox
dropdownlist when the mousepointer is over the item. Seems to me it
should
be possible since the item "highlights" when the mouse passes over the
different items listed, but the end user hasn't yet "clicked/selected" any
specific item. I know it can be done with a listbox. Basically looking
for
the LB_ITEMFROMPOINT equivalent for Comboboxes. Does anyone have any
idea
how to accomplish this with a combobox? Please help.

Sep 22 '06 #2
Easton wrote:
I'm trying to derive the index of any random item in a populated combobox
dropdownlist when the mousepointer is over the item. Seems to me it should
be possible since the item "highlights" when the mouse passes over the
different items listed, but the end user hasn't yet "clicked/selected" any
specific item.
If you create a Control derived from ComboBox, make it OwnerDrawn and
override the DrawItem method, you should be able to pick out the
currently "hovered" item based on each item's style. (IIRC, the item's
index is passed as part of the Event Arguments).

Not something to take on lightly, but it you /really want to...

Regards,
Phill W.
Sep 22 '06 #3
Yes, my application would use the index to derive a preview of information to
help the end user make the best possible choice from the combobox.

"Cor Ligthert [MVP]" wrote:
Easton,

Any reason that you want to do this, it sound for me forever stupid that
people want to confrontate users with non standard behaviour. Something from
the 80's in the previous century.

Cor

"Easton" <Ea****@discussions.microsoft.comschreef in bericht
news:52**********************************@microsof t.com...
To anyone who might be able to help.

I'm trying to derive the index of any random item in a populated combobox
dropdownlist when the mousepointer is over the item. Seems to me it
should
be possible since the item "highlights" when the mouse passes over the
different items listed, but the end user hasn't yet "clicked/selected" any
specific item. I know it can be done with a listbox. Basically looking
for
the LB_ITEMFROMPOINT equivalent for Comboboxes. Does anyone have any
idea
how to accomplish this with a combobox? Please help.


Sep 22 '06 #4
Thank you Phill, I've been headed in that direction as well. Would you
happend to know what event I should be watching?

"Phill W." wrote:
Easton wrote:
I'm trying to derive the index of any random item in a populated combobox
dropdownlist when the mousepointer is over the item. Seems to me it should
be possible since the item "highlights" when the mouse passes over the
different items listed, but the end user hasn't yet "clicked/selected" any
specific item.

If you create a Control derived from ComboBox, make it OwnerDrawn and
override the DrawItem method, you should be able to pick out the
currently "hovered" item based on each item's style. (IIRC, the item's
index is passed as part of the Event Arguments).

Not something to take on lightly, but it you /really want to...

Regards,
Phill W.
Sep 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wayne Wengert | last post by:
I am trying to populate a combobox with a lisy of items. I want the 1st item to be "Make a Selection" and the following items will be names from a table in my DB (See code below). When I run the...
1
by: ORC | last post by:
Is it possible to set the index value in a comboBox to a user defined value like e.g having a combobox with indexes 1, 12, and 20 and nothing else? Thanks Ole
1
by: Rachel Suddeth | last post by:
When I put a ComboBox on a form, I can enter strings through the designer to fill Items collections. I have put a ComboBox in a UserControl, and exposed the the Items collections with the same...
5
by: James P. | last post by:
Hello, For my new Windows application, all I want is to create an initial form to demo to the user to show them how it looks like with some data on it. So I figure the fastest way is to create...
6
by: Sakharam Phapale | last post by:
Hi All, How to fill one ComboBox from other ComboBox control? 1) Only setting the reference does the trick but doesn't show items in control. If you see in immediate window, it shows...
2
by: FaWiizio | last post by:
Is it possible to add an item to a combobox this way: ComboBox1.Items.Add("Cool!") AND assign to this new Item a unique index ? As in HTML <option value="1">Cool</option>
2
by: murdock | last post by:
I am having an issue with graphical corruption upon re-selecting a combobox which upon 'selected index change' event should list file names in that folder in a separate combobox. Here is the code:...
7
by: samoore33 | last post by:
I am trying to dynamically add items to a listbox or combobox. The items add to either, but when I look through those items, there is nothing there. If I choose an item, it shows up. Not sure...
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to create a customized ComboBox where the methods ComboBox.Items.Add and ComboBox.Items.Insert will behave thusly: -- If the item is not present, add it. -- If the item is present, set the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.