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();
}
}
}
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();
}
}
}