PC Review


Reply
Thread Tools Rate Thread

how to draw columns ?

 
 
--== Alain ==--
Guest
Posts: n/a
 
      15th Feb 2007
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.
 
Reply With Quote
 
 
 
 
ClayB
Guest
Posts: n/a
 
      15th Feb 2007
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.


 
Reply With Quote
 
--== Alain ==--
Guest
Posts: n/a
 
      16th Feb 2007
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.

ClayB wrote:
> 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.
>
>

 
Reply With Quote
 
ClayB
Guest
Posts: n/a
 
      16th Feb 2007
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.

 
Reply With Quote
 
--== Alain ==--
Guest
Posts: n/a
 
      17th Feb 2007
It is derived from Component.

ClayB wrote:
> 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.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Draw A Line Across Both Columns Keith Wilby Microsoft Access 0 10th Sep 2009 08:52 AM
Re: Draw A Line Across Both Columns Keith Wilby Microsoft Access Reports 0 10th Sep 2009 08:52 AM
Re: Draw A Line Across Both Columns Keith Wilby Microsoft Access 0 9th Sep 2009 08:57 AM
Re: Draw A Line Across Both Columns Keith Wilby Microsoft Access Reports 0 9th Sep 2009 08:57 AM
Using VLOOKUP to draw data from two columns =?Utf-8?B?RGFu?= Microsoft Excel Misc 5 25th Jun 2005 12:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:10 PM.