HighTechTalks DotNet Forums  

Does OnPaintAdornments work with DesignSurface?

Dotnet Framework (WinForms DesignTime) microsoft.public.dotnet.framework.windowsforms.designtime


Discuss Does OnPaintAdornments work with DesignSurface? in the Dotnet Framework (WinForms DesignTime) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
tribbles
 
Posts: n/a

Default Does OnPaintAdornments work with DesignSurface? - 10-03-2007 , 05:20 PM






I've been trying to figure out ControlDesigners of late... I have a
custom design surface in which I've used the OnPaint event to change
the visual appearance of my user controls. When I add a
ControlDesigner, all of the custom paint work goes away. So I added
an OnPaintAdornments and did the same work and nothing happens...
Apparently I'm missing something, just not sure what.

The original OnPaint is:

protected override void OnPaint(PaintEventArgs e) {
base.OnPaint(e);

PaintHelper.PaintBorder(e, this, borderColor, borderType,
borderSize);
}

The OnPaintAdornments is:
protected override void OnPaintAdornments(PaintEventArgs pe) {
base.OnPaintAdornments(pe);

KcRepeaterPanel ctrl = (KcRepeaterPanel)Control;

if (ctrl == null) return;

PaintHelper.PaintBorder(pe, ctrl, ctrl.BorderColor,
ctrl.BorderType, ctrl.BorderSize);
}

The parent class declaration and attribs:

[Designer(typeof(RepeaterPanelControlDesigner))]
[PropertyIncludeList(new string[] {
"Font",
"FontColor",
"BackgroundColor",
"PanelHeight",
//"ViewOnly", // Inverse of IsEnabled and stores out as
IsEnabled
//"IsVisible",
"AlphaTransparency",
"StartGradientColor",
"BorderColor",
"BorderSize",
"BorderType",
"HiddenControlList"
})]
[XmlClass(typeof(ControlSerializer))]
[XmlClassFieldInclude(new string[] {
"Font",
"FontColor",
"Location",
"Size",
"BackgroundColor",
"TabIndex",
"Controls",
"IsEnabled",
"IsVisible",
"AlphaTransparency",
"StartGradientColor",
"BorderColor",
"BorderSize",
"BorderType",
"HiddenControlList"
})]
public class KcRepeaterPanel : Panel, IAdditionalParsing,
IControlSerializationXmlType, IID, IVisible,
IControlBindingRelink, IConformance, IHiddenControls,
IViewOnly, IFormatColor, IBorder
{


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.