Q: Updating a control in design time

  • Thread starter Visual Systems AB \(Martin Arvidsson\)
  • Start date
V

Visual Systems AB \(Martin Arvidsson\)

Hi!

Created an inherited combobox, (with a little help) how ever. When i set the
property
CharacterCase to false, i must rebuild the project in order for the text to
be in non uppercase.
Is there a method to use to redraw the control, i have tried, see code
below.

Regards
Martin

<---- CODE ----->
class UCComboBox : ComboBox
{
private bool _CharacterCase = true;

protected override CreateParams CreateParams
{
get
{
const int CBS_UPPERCASE = 0x2000;
CreateParams cp = base.CreateParams;
if (_CharacterCase)
cp.Style |= CBS_UPPERCASE;
return cp;
}
}

public bool CharacterCase
{
get
{
return _CharacterCase;
}
set
{
_CharacterCase = value;
this.Invalidate();
}
}
}
 
K

Kevin Spencer

You would have to create a Custom Designer for the Control.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
V

Visual Systems AB \(Martin Arvidsson\)

Hi!

I have been struggeling for a while with this, but perhaps you can supply me
with a link on msdn on how to do this.

Regards
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top