G
Guest
Hello,
I have to create my own control which might be an extension for a standard
'panel' control. I called it 'SmartPanel'. This is specialized panel. It
consists of a title bar and a client area on which other controls can be
placed. Depends on its state, it can shrink into one of its borders so only
title bar is visible in shrinked state. Problem is as follows: I want to be a
title bar with name of panel (e.g "Tools") and I paint it in a OnPaint event.
It is all ok, but when I put on my panel some other control (e.g other Panel
or Button) and when I set its Docking style (e.g to DockStyle.Right) its
covering title bar of my SmartPanel! I tried to figure out what's going on. I
found ClientSize property. Fine, but I can't use in when my SmartPanel is in
state 'dock to left' or 'dock to bottom' because of title bar is at beginning
of client area. ClientRectangle property is read only and in MSDN is written
that "the coordinates of the upper-left corner of the rectangle returned by
this property are (0,0)", but I want to upper-left corner starts at (0, 20)
for example. Please help me to solve this setting me mad problem...
thanks for advance.
I have to create my own control which might be an extension for a standard
'panel' control. I called it 'SmartPanel'. This is specialized panel. It
consists of a title bar and a client area on which other controls can be
placed. Depends on its state, it can shrink into one of its borders so only
title bar is visible in shrinked state. Problem is as follows: I want to be a
title bar with name of panel (e.g "Tools") and I paint it in a OnPaint event.
It is all ok, but when I put on my panel some other control (e.g other Panel
or Button) and when I set its Docking style (e.g to DockStyle.Right) its
covering title bar of my SmartPanel! I tried to figure out what's going on. I
found ClientSize property. Fine, but I can't use in when my SmartPanel is in
state 'dock to left' or 'dock to bottom' because of title bar is at beginning
of client area. ClientRectangle property is read only and in MSDN is written
that "the coordinates of the upper-left corner of the rectangle returned by
this property are (0,0)", but I want to upper-left corner starts at (0, 20)
for example. Please help me to solve this setting me mad problem...
thanks for advance.