Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionTreeChart.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionTreeChart.Designer.cs	(revision 3469)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionTreeChart.Designer.cs	(revision 3470)
@@ -25,22 +25,6 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
-      this.pictureBox = new System.Windows.Forms.PictureBox();
       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
-      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
       this.SuspendLayout();
-      // 
-      // pictureBox
-      // 
-      this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.pictureBox.Location = new System.Drawing.Point(0, 0);
-      this.pictureBox.Name = "pictureBox";
-      this.pictureBox.Size = new System.Drawing.Size(150, 150);
-      this.pictureBox.TabIndex = 0;
-      this.pictureBox.TabStop = false;
-      this.pictureBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseMove);
-      this.pictureBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseDoubleClick);
-      this.pictureBox.MouseClick += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseClick);
-      this.pictureBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseDown);
-      this.pictureBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseUp);
       // 
       // SymbolicExpressionTreeChart
@@ -48,14 +32,10 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.pictureBox);
       this.Name = "SymbolicExpressionTreeChart";
-      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
       this.ResumeLayout(false);
-
     }
 
     #endregion
 
-    private System.Windows.Forms.PictureBox pictureBox;
     private System.Windows.Forms.ToolTip toolTip;
   }
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionTreeChart.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionTreeChart.cs	(revision 3469)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionTreeChart.cs	(revision 3470)
@@ -31,4 +31,5 @@
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
   public sealed partial class SymbolicExpressionTreeChart : UserControl {
+    private Image image;
     private StringFormat stringFormat;
     private Dictionary<SymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode> visualTreeNodes;
@@ -36,8 +37,8 @@
     public SymbolicExpressionTreeChart() {
       InitializeComponent();
+      this.image = new Bitmap(Width, Height);
       this.stringFormat = new StringFormat();
-      stringFormat.Alignment = StringAlignment.Center;
-      stringFormat.LineAlignment = StringAlignment.Center;
-      pictureBox.Image = new Bitmap(pictureBox.Width, pictureBox.Height);
+      this.stringFormat.Alignment = StringAlignment.Center;
+      this.stringFormat.LineAlignment = StringAlignment.Center;
       this.spacing = 5;
       this.lineColor = Color.Black;
@@ -101,7 +102,24 @@
     }
 
+    protected override void OnPaint(PaintEventArgs e) {
+      base.OnPaint(e);
+      e.Graphics.DrawImage(image, 0, 0);
+    }
+    protected override void OnResize(EventArgs e) {
+      base.OnResize(e);
+      if (this.Width == 0 || this.Height == 0)
+        this.image = new Bitmap(1, 1);
+      else
+        this.image = new Bitmap(Width, Height);
+      this.Repaint();
+    }
 
     public void Repaint() {
-      using (Graphics graphics = Graphics.FromImage(pictureBox.Image)) {
+      this.GenerateImage();
+      this.Refresh();
+    }
+
+    private void GenerateImage() {
+      using (Graphics graphics = Graphics.FromImage(image)) {
         graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
         graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
@@ -111,6 +129,4 @@
           DrawFunctionTree(tree, graphics, 0, 0, this.Width, height);
         }
-
-        pictureBox.Refresh();
       }
     }
@@ -188,10 +204,4 @@
 
     #region methods for painting the symbolic expression tree
-    protected override void OnResize(EventArgs e) {
-      base.OnResize(e);
-      pictureBox.Image = new Bitmap(pictureBox.Width, pictureBox.Height);
-      Repaint();
-    }
-
     private void DrawFunctionTree(SymbolicExpressionTree tree, Graphics graphics, int x, int y, int width, int height) {
       DrawFunctionTree(tree.Root, graphics, x, y, width, height, Point.Empty);
@@ -276,5 +286,4 @@
     }
     #endregion
-
   }
 }
