how to draw columns ?

A

--== Alain ==--

Hi,

I'm developing a custom control, which has "rows" and "columns"
collections properties.
when i add/remove columns/rows, i want to redraw my control.
Each column should be redrawn with their relative background color.

this is for the principle...

My problem is how to code it :-(

I mean, every time that a property change, i should redraw the control.
I was thinking to use eventhandler for that, but i do not have any idea
where to start.

Could someone forward me to some example ?

thanks a lot,

Al.
 
C

ClayB

Inside the setter method of your property, if the new 'value' differs
from the current value, the redraw the control after setting the
value.

public string RuleString
{
get { return ruleString; }
set
{
if (value != ruleString)
{
ruleString = value;
this.Refresh();//redraw the control
}
}
}
=============
Clay Burch
Syncfusion, Inc.
 
A

--== Alain ==--

Hi Clay,

How to do if the the property is in fact a class that does not contain a
Refresh property ?

that's why i was thinking about eventHandler to walkaround this issue.
But i do not know where to start as my property is in fact a class.

I was thinking in my class to write an eventhandler, and when the
property change to raise the event.

Event will be trapped by my custom control method which will refresh itself.

Al.
 
C

ClayB

If your class derives from Control, then it would inherit
Control.Refresh. Also in this case, you could do a
control.Invalidate() followed by a control.Update() to redraw things.

Exactly from what are you deriving your custom control?

==============
Clay Burch
Syncfusion, Inc.
 

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