public void ActivatePaintHandler(PaintEventHandler theHandler){this.Paint -= oldPaintEventHandler;if (null != theHandler){this.Paint += theHandler;}}
public static void getStyle(ControlButton theButton){if (myStyleTheme == StyleTheme.Window){theButton.ActivatePaintHandler(new PaintEventHandler(theButton.OnPaint3));}else if (myStyleTheme == StyleTheme.one){theButton.ActivatePaintHandler(new PaintEventHandler(theButton.OnPaint2));}else{//***********************// this is the paint handler which is located here//***********************theButton.ActivatePaintHandler(new PaintEventHandler(OnPaint4));}}