473,508 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Owner drawn combo question

Hi All,

I'm working on an owner-drawn combo box which will display multiple
columns in the list, either from a table in an associated DataSourse or
from delimited strings in the Items collection. It's all going quite
well, and was actually easier to achieve than I had expected.

But I am seeing one peculiar anomaly when I make a selection from the
list. Eveything works perfectly if the list is populated from a
DataSource. But if the list is populated from the typed-in Items
collection, AND the DropDownStyle is set to Simple or DropDown, the
edit field appears to get re-drawn WITHOUT the DrawItem method being
called! Or if it IS called, the DrawItemState does NOT have the flag
set indicating this is the edit field being drawn. The only pattern I
can see here is that the 2 DropDownStyles that do this are the ones
where the edit field is editable by the user. But I can't see why that
should matter.

The above is what I THINK is happening - it's actually quite difficult
to debug this, because the switching of focus between the test form and
the code window generates all sorts of events which confuse the issue
greatly. In my DrawItem code I test for the flag telling me the edit
field is being drawn, and if I put a breakpoint in the code, it is
never hit in the conditions described.

Anyone know what is going on here? Is there some other event I need to
override? Another flag in the DrawItemState? Is this a bug in .NET?

Thanks and regards

Jul 21 '06 #1
0 947

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

Similar topics

0
1795
by: James | last post by:
Is there a way to Owner drawn tray context menu ? - I know that there is a bug with the custom drawing of a context menu assigned to a tray icon - but I was hoping someone could advise me as to how...
1
2818
by: boxim | last post by:
hi all, i need to develop a control to show contact details for companies, in a similar fashion to the way outlook shows contacts. at the moment, i'm cheating using HTML fed from a web server,...
2
2487
by: Eric | last post by:
I implemented owner drawing on the main and context menus of my main form. It works fine. There is also a notify icon control that has a context menu. When the icon is in the status bar, it...
1
2081
by: Michael C | last post by:
Anyone know if there are some code samples out there of owner-drawn buttons? Specifically I'm trying to create .NET IDE style buttons for a form. Thanks, Michael C.
1
2851
by: Patty O'Dors | last post by:
Hi I have some code to create an ownerdrawn listbox (derived), and when I add an item to it, the bold text of the first item (the title, 'Collections and Maturities') mysteriously seems to get...
2
3109
by: dan heskett | last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some custom "fields" and text layout. Essentially it works, but I must be missing something big, conceptually, because I...
0
1619
by: Brian Henry | last post by:
Ok whats going on here... got a couple problems... this is relevant now to this group since .NET 2.0 is finally RTM 1) draws really slow when making it a large form (resizing speed is jerky) to...
0
1404
by: Brian Henry | last post by:
I cant seem to remember this one... I have a list view, and im owner drawing the items, i dont want the selection to hide when it loses focus so i have hideselection = false, but when i owner draw...
0
2665
by: LostInMd | last post by:
Hi All, I've got an owner drawn listBox where I draw and measure the items that I add to the listBox. For example, I have a listBox that can only display 10 characters on each horizontal line. ...
0
7123
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...
0
7324
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,...
1
7042
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...
0
7495
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5052
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3193
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...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
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 ...
0
418
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...

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.