I would like to extend the System.Windows.Forms.ComboBox control with a ReadOnly property, which would display the selected item’s text (similar to a label) when ReadOnly = true. (I do not like the disabled look achieved by setting Enabled=false)
How do I do this in winforms? It was really simple in ASP.NET where all I had to do was override the Render method. It doesn’t seem so straightforward with winforms however.
From what I gather I need to
a) Override the OnPaint method
b) Call this.SetStyle(ControlStyles.UserPaint, true) so that OnPaint is called.
But now it seems like I have to do ALL the painting myself. Is that true? Is it not possible to let the base ComboBox deal with painting the control when ReadOnly = false? Also, what ControlStyles should I be using?