dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [DotGNU]Winforms ComboBox


From: Neil Cawse
Subject: RE: [DotGNU]Winforms ComboBox
Date: Mon, 28 Jul 2003 23:16:28 -0400

> Ok so this week I'm going to work on implementing ComboBox.  I have a few questions I'd like to ask the list on
> how I'm going to design this to work.  Since I need text input, should I make ComboBox a composite control? 
> Doing this I will have to use TextBox, and handle the TextBox.Paint event so I can draw the dropdown arrow.
 
> Is this the correct way for me to go about this?
 
Use all the features, and power of the framework, like docking/anchoring. Create a composite control with a textbox (no border) and button, you draw the border. We can worry about hiding the fact that its a composite control later if we really want to look fully like the ms control. You won't handle TextBox.Paint, just your own Paint.
so in the constructor of the combo:
TextBox textBox = new TextBox();
...
Controls.Add(textBox);
same for button.
When the combobox is painted, the textBox and button will automatically be painted, you just draw the border and the drop down if necessary.
 
Shout for any help.
 
Neil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]