|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Fake PaintEventArgs?class FakeButton : Button { public void DoFakePaint(PaintEventArgs e) { base.OnPaint(e); } } class UserControlClass : UserControl { FakeButton fb; public UserControlClass() { InitializeComponent();//.... standard stuff this.Paint += new PaintEventHandler(this.MyPaint); fb = new FakeButton(); fb.Size = this.Size; fb.Text = "something"; } private void MyPaint(object sender, PaintEventArgs e) { fb.DoFakePaint(e); } } This basically instructs the button to paint itself on the graphics for UserControlClass. What I want is to be able to do the same thing using TextBox & different other complex controls. I got it working for the simple ones like Label, CheckBox, Link... but ListBox, ComboBox, TextBox don't draw anything (if I call base.OnPaintBackground(e) in DoFakePaint all they do is paint a square with the bg color but nothing else). Is this possible? What makes the difference between these controls? thx |
|||||||||||||||||||||||