473,406 Members | 2,220 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,406 software developers and data experts.

how to draw columns ?

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.
Feb 15 '07 #1
4 1579
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.
Feb 15 '07 #2
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.

Feb 16 '07 #3
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.

Feb 16 '07 #4
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.
Feb 17 '07 #5

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

Similar topics

0
by: Florida Draw | last post by:
------=_NextPart_000_0012_1D5428A2.65C196F8 Content-Type: text/plain Content-Transfer-Encoding: 8bit Sign-up for the FREE Holiday Giveaway Draw You must register to be eligible for the draw....
4
by: Kai Grossjohann | last post by:
I have a file which contains component definitions, along with their x/y coordinates and width and height. Examples for components are a short text string, a text entry field, a date entry field,...
21
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do...
5
by: Matt | last post by:
I am writing a recursive program to draw the lines recursively, given the range and number of intervals (n) between the range. The problem is I don't know how to draw the line in point 0.375, as...
0
by: tcv | last post by:
Hi folks, I have a need to draw customized table dynamically in my asp.net page. For example, i have a template table of 2 rows and 6 colums. Depending on the data from the backend I need to re...
9
by: zhaow | last post by:
Hi, All Greetings! I want to develop as appllication that requires a line-drawing function in the blank area between two forms. I have looked up the MSDN, it says that a graphics object need a...
7
by: yugas | last post by:
how to write a c program to draw a rectangular grid having 10 rows and 10 columns. please help me.
2
by: NithyaMM | last post by:
Hi, Draw table using line between rows and Columns Help me
0
by: Kevinst | last post by:
Hello, currently I am working on the following scenario: There is a device connected to my application. That device has a 256x256 pixel display showing graphics and text. Now for each pixel...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.