473,569 Members | 2,762 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 951

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

Similar topics

0
1800
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 to create one from scratch - I have tried using the current cursor position to pop up a context menu that is not assigned to a tray icon - but with...
1
2822
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, however i need to now make it use it's own control. what's the best way of doing this? tia
2
2500
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 works perfectly fine when it is double-clicked. However, when I try to initialize the notify icon's context menu as an owner-drawn menu, all the text...
1
2083
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
2861
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 bunched up at the right, i.e. squashed up! any idea why? The main bit of the code is as such // (in progressReporter.cs) protected struct LBRow...
2
3114
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 get all kinds of screen artifacts and weirdness. My general goal is: list item with a few areas for text, every other item shaded a light color for...
0
1625
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 a res from 100x100 to 1280x1024 once it gets above 500x500 it starts jerking you can see the screen refreshing as it paints 2) sometimes the...
0
1411
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 this all the items come up gray instead of just the one that is selected when focus is lost, the blue one shows up correctly when it has focus......
0
2670
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. The majority of my items contain much more than 10 characters and thus the reason for my use of owner drawn listBoxes - I do not want to use a...
0
8118
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...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
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...
1
5504
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
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
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
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...

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.