473,408 Members | 1,759 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,408 software developers and data experts.

problems with creategraphics and combo_click event.

hi,
now actually i want to design custom combo in which combo's button (in
which down arrow is there to perform clicking for dropdown type of
combo) should be also black in color. so as it's not possible directly
to change that i drawn image over that click button of combo using
this.comboBox1.CreateGraphics().FillRectangle(Syst em.Drawing.Brushes.Black,90,0,20,30);
but it is drawing this only once on form load and when i click on
combo this image disappears so my problem is this even after clicking
a combo that image should remain there.how can i do it?

It would be great help to me if you can provide any suggestion.

Regards,
S. Domadia.
Nov 16 '05 #1
1 1255
Hi S Domadia,

This behaviour is as expected. The comboBox is repainted at various times, for instance when you click the button. However (I assume you put your painting code in the form's paint event), the combobox's text box and button handles it's own drawing, and doesn't let you take part of it. So when clicking, the form won't get noticed, so the form won't paint the black rectangle.

There may be some way to tap into windows to capture the button drawing event, but I'm not sure how to do it. You may have to make your own custom control. Maybe using a text box, a button, and a list box.

Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2

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

Similar topics

2
by: Senne Vaeyens | last post by:
Hi, I'm writing an app that will show a scrolling transparent graph and I'm ancountering some problems, explained in the following code: (a VS project explaining the problem(s) can be downloaded...
6
by: mphanke | last post by:
Hi, I'm desperately trying to print a string on top of an image, but for whatever reason the images allways stays on top of my canvas! Is there some trick how to implement things? I call ...
1
by: JH | last post by:
I have a tab control in my form. I am trying to create a dynamic pie chart. If I use the following code,it works fine on the main form. this.CreateGraphics().FillPie(brushtargeted,240,200,200, 200,...
11
by: active | last post by:
picInfo is a PictureBox that I write into when the mouse moves. Below is a snip of the code. The text flashes on the screen but does not stay there. Anyone know why? Second question.-...
6
by: saunderl | last post by:
Hello Everyone, I'm trying to just play with managed VC++. I just want to draw a box on the form when it is clicked. Here is my click event handler System::Void Test_Click(System::Object^ ...
8
by: pigeonrandle | last post by:
Hi, Please pity me, i am on a dial-up connection for the first time in 5 years :( ! Does anyone know how the resulting Graphics objects differ ...? What i really mean is can someone explain it...
4
by: giddy | last post by:
hi when i run this class i made here , this is what it looks like without text - http://gidsfiles.googlepages.com/LinedTextBox_1.jpg WITH TEXT (heres the issue) -...
6
by: active | last post by:
I did the following and then wondered it's good practice. Me.CreateGraphics.DrawImage(Img, 0, 0) I'm thinking about disposing the Graphics object. A couple of lines after this I exit the sub...
0
by: Tyreec | last post by:
Hi, I am hoping that someone can give me some pointers on where I am going wrong. First some background. I wanted to create a windows application that would draw a map that could be scaled...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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
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,...
0
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
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...
0
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,...
0
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...

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.