472,989 Members | 3,144 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Draw control doesn't redraw on SplitPanel

hi @all,

I have a simple draw control which uses the OnPaint event:

protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
CalculatePaint();
DrawCanvas(pe.Graphics);
if (ShowGrid)
DrawGrid(pe.Graphics);
DrawDocument(pe.Graphics);
DrawLabels(pe.Graphics);
}

It redraws fine, when I resize the window. But when it's placed on a
SplitPanel and I change the size with the splitter, the control is
almost never redrawn.

What have I missed here?

Do I need to Invalidate() my control in a resize event?
btw, CalculatePaint() does the calculation of the client rectangle,
basically this own:

_ClientRect = new RectangleF(
Padding.Left,
Padding.Top,
Width - Padding.Left - Padding.Right - 1,
Height - Padding.Top - Padding.Bottom - 1);
mfG
--stefan <--
Sep 10 '08 #1
1 1646
On Wed, 10 Sep 2008 09:32:37 -0700, Stefan Hoffmann
<st*************@explido.dewrote:
[...]
Do I need to Invalidate() my control in a resize event?
If the visual aspects of your control depend on its size, yes. You do.

Pete
Sep 10 '08 #2

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

Similar topics

1
by: David | last post by:
Hello, I'm starting with java and i'm having problems to display an image in a splitpanel with a scrollbar. I have different files but those required are described below. I think the problem is...
1
by: Tim Haughton | last post by:
Like most fans of eye candy, I've always thought the standard MainMenu control was a bit drab. After looking at third party components, I decided to see if I could brute force it into looking nice....
4
by: Mathieu Chavoutier | last post by:
Hi. I would like to do something like paint. I try to draw a line. I want, like paint, that when I clickdown, it begins to draw the line, and then, when I move the mouse, the line follow the...
8
by: George | last post by:
Hello everyone, I am using C# on a Pocket PC 2003 project based on .Net Compact Framework of Visual Studio 2005. I want to re-draw some controls of a Form (Window) at a regular interval (for...
4
by: --== Alain ==-- | last post by:
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...
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...
10
by: Phil | last post by:
I would like to draw some text which will be in front of any other controls, but without obscuring them completely. If I use DrawString in the form's Paint handler the text is always behind, not in...
1
by: Sin Jeong-hun | last post by:
I have created a simple custom control, which displays a string data on it. It draws the string at its OnPaint(). When the string is changed I can call Invalidate() to redraw the string. Sort of...
3
by: Brandon Arnold | last post by:
I have a panel that contains a label and a picturebox. When clicked, I want to draw a rectangle over everything. I can draw the rect and set the color, no big deal. The problem is because I have to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.