473,399 Members | 4,254 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,399 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 1659
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.