Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3918 for trunk/sources


Ignore:
Timestamp:
06/14/10 15:35:38 (14 years ago)
Author:
mkommend
Message:

added bug fixes to avoid CreateWindowHandle exceptions (ticket #972)

Location:
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForm.cs

    r3796 r3918  
    239239      if (this.ShowContentInViewHost) {
    240240        ViewHost viewHost = new ViewHost();
     241        viewHost.Content = content;
    241242        viewHost.ViewType = viewType;
    242243        view = viewHost;
    243       } else
     244        view.Show();
     245      } else {
    244246        view = MainFormManager.CreateView(viewType);
    245 
    246       if (view != null) {
    247         view.Show();
    248         view.Content = content;
    249       }
     247        if (view != null) {
     248          view.Content = content;
     249          view.Show();
     250        }
     251      }
     252
    250253      return view;
    251254    }
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs

    r3863 r3918  
    100100        if (viewContextMenuStrip.Items.Count == 0) {
    101101          messageLabel.Visible = true;
    102           viewsLabel.Visible = false;
     102          viewsLabel.Enabled = false;
    103103          viewPanel.Visible = false;
    104104        } else {
    105105          messageLabel.Visible = false;
    106           viewsLabel.Visible = true;
     106          viewsLabel.Enabled = true;
    107107          viewPanel.Visible = true;
    108108        }
     
    126126      } else {
    127127        messageLabel.Visible = false;
    128         viewsLabel.Visible = false;
     128        viewsLabel.Enabled = false;
    129129        viewPanel.Visible = false;
    130130      }
     
    132132
    133133    private void OnViewTypeChanged() {
     134      for (int i = viewPanel.Controls.Count - 1; i > 0; i--)
     135        viewPanel.Controls[i].Dispose();
    134136      viewPanel.Controls.Clear();
     137
    135138      if (viewType == null || Content == null)
    136139        return;
     
    152155        view.ReadOnly = this.ReadOnly;
    153156        view.Locked = this.Locked;
     157        view.Content = Content;
    154158        cachedViews.Add(viewType, view);
    155159      }
     
    159163      viewPanel.Controls.Add(control);
    160164      viewPanel.Visible = true;
    161       view.Content = Content;
     165      viewPanel.Refresh();
    162166    }
    163167
Note: See TracChangeset for help on using the changeset viewer.