473,671 Members | 2,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox w/ DrawItem, AND AutoComplete

Hey guys,

I've got a combo box where I'm passing values to the ComboBox using a
listitem class I created. I use the listitem class to do three things:

1 - Send the display text (What you see in the pull down)
2 - Send the GUID of the item (hidden)
3 - Send the color that the item will be displayed in in the drop down.
I use the following code to do this in my OnDrawItem even:

String drawString =
this.cBxPlayerL ist.Items[e.Index].ToString();
Font drawFont = new Font("Veranda", 10, FontStyle.Bold) ;
aColor =
((ListItemSC)th is.cBxPlayerLis t.Items[e.Index]).SelColor;
SolidBrush drawBrush = new SolidBrush(aCol or);
PointF drawPoint = new PointF(e.Bounds .X, e.Bounds.Y);
e.Graphics.Draw String(drawStri ng, drawFont, drawBrush,
drawPoint);
cBxPlayerList.A utoCompleteMode =
AutoCompleteMod e.SuggestAppend ;

Here is my problem, ever since doing this... the cursor / highlight on the
drop-down list is gone, and AutoComplete no longer works. Any idea?
Thanks!!!
Sep 30 '08 #1
0 1066

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

Similar topics

2
10632
by: VM | last post by:
How can I implement the autocomplete functionality in a Windows comboBox? Thanks.
0
1911
by: Andrew Baker | last post by:
Have a look at the code below. It's a really simple example where I have added two controls to a form, a textbox and a combo box. Both add owner drawn context menus to the controls, but the combobox will NOT draw custom drawn context menu item. I have tried EVERYTHING (deriving from MenuItem and even tried calling TrackPopupMenuEx directly), but it just won't work! I am currently reflecting over the combobox source code (oh joy!), but...
3
2228
by: RajW | last post by:
Is it possible to have an auto complete ComboBox in ASP.NET? I would like to create a ComboBox that functions similarly to the way that IE will try to autocomplete a URL as you type it in. Thanks, /*Raj*/
0
1733
by: Kenneth P. Graci | last post by:
Hi, vb.net - windows forms I need to know when the dropdown list on my derived combobox closes. There is a DropDown event and a OnDropDown override, but I want to know when it closes. It is an ownerdrawn combobox, so i am handling the Drawitem event myself.
19
18327
by: Bernie Yaeger | last post by:
Everyone misses the point on this - what we need is a combobox autocomplete that is a dropdownlist only. When in dropdown mode, you can enter text - making that autocomplete is trivial. But when you look at combobox controls from years ago, they would autocomplete in dropdownlist mode. And if you look at intellisense, this is exactly what happens, so obviously the .net framework can do it. Any help would be much appreciated. Bernie...
2
1635
by: Becker | last post by:
I have a need for a simple combobox on a form in one of my programs that represents city, state. I want to have it autocomplete as the user types. I have a table with these values (about 50k of them) and I'd like to source it from there. I have seen some methods out there for the autocomplete, but I think that pulling 50k in the combobox might be too slow at runtime to build a table of all those records and then bind the entire combobox...
2
2222
by: Kalvin | last post by:
I found some code in Google, don't remember where, for an AutoComplete combobox. Everything is great with it except for one thing. If I use the mouse to drop the list down, then start typing to find the item in the list, the visible text changes, but the values of me.Text and Mybase.Text do not change. If you use the mouse and actually click on the item, the values of me.text and Mybase.Text will change. Or, if you use the enter key to...
4
5099
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I have to load 30,000 unique names into a combox. Filling a dataTable takes only a few milliseconds. But populating the combobox and displaying the list takes several seconds - way too long. A user selects a name from the combobox and runs a query. Originally, this combox was on a form in an MS Access ADP which was linked directly to our sql server. The combobox populated withins millisecnods. How can I achieve this...
6
7316
by: ezyeric13 | last post by:
I have a series of ComboBox's Bound to a DataGridView and I turned the AutoComplete on for them so they list all the items in a certain collumn of the DataGridView. The problem is that when you use the Tab key to finish the Autocomplete it both selects that item and moves to the next Control in the Tab Order. I personally prefer to use the Enter key (to select autocomplete items) but many users are used to the Tab key.
0
8476
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8914
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8820
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7433
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4224
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2810
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1809
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.