473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Q: Updating a control in design time

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();
}
}
}
Nov 17 '05 #1
3 1350
You would have to create a Custom Designer for the Control.

--
HTH,

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

"Visual Systems AB (Martin Arvidsson)" <ma**************@vsab.net> wrote in
message news:O$**************@TK2MSFTNGP12.phx.gbl...
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();
}
}
}

Nov 17 '05 #2
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

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:OB***************@TK2MSFTNGP15.phx.gbl...
You would have to create a Custom Designer for the Control.

--
HTH,

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

"Visual Systems AB (Martin Arvidsson)" <ma**************@vsab.net> wrote in message news:O$**************@TK2MSFTNGP12.phx.gbl...
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();
}
}
}


Nov 17 '05 #3
Sure, Martin. Here are a couple:

http://msdn.microsoft.com/msdnmag/is...r/default.aspx
http://msdn.microsoft.com/library/de...sgnrdotnet.asp

--
HTH,

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

"Visual Systems AB (Martin Arvidsson)" <ma**************@vsab.net> wrote in
message news:ug*************@TK2MSFTNGP10.phx.gbl...
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

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:OB***************@TK2MSFTNGP15.phx.gbl...
You would have to create a Custom Designer for the Control.

--
HTH,

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

"Visual Systems AB (Martin Arvidsson)" <ma**************@vsab.net> wrote

in
message news:O$**************@TK2MSFTNGP12.phx.gbl...
> 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();
> }
> }
> }
>
>



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Michael Chapman | last post by:
I have a UserControl-derived class that behaves somewhat strangely in the form designer. Some properties (BorderStyle and Font) cause the control to be updated in the designer, but others...
4
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
3
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
11
by: Rimpinths | last post by:
I'm new at developing user controls in C#, and one thing I've noticed right off the bat is that the constructor gets called twice -- once at design time, once at run time. In short, I'm trying...
4
by: Mark Olbert | last post by:
I've written a composite custom control which I would like to have update its design-time display when one of several properties changes at design time. These custom properties are not simply the...
33
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range...
4
by: directory | last post by:
hey guys, I've got a weird one for ya....i have a form which takes user input in the form of textbox's etc. It then grabs some details from a file and updates some of the labels with some info...
14
by: Adam Sandler | last post by:
I have a class with a method which returns a panel. The panel was not created with the visual editor, I coded it by hand -- because some of the content on the panel can be dynamic and thus I chose...
5
by: gerry | last post by:
I am trying to create a custom container control that will only ever contain a specific type of control. At design time, when a control of a different type is added to the container I would like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.