private void pictureBox1_Click(object sender, EventArgs e)
    {
      if (m_dt == null || m_controlType == null)
      {
        MessageBox.Show("You need to call 'Create' on the ShowChartSeparateControl with argument so that it knows how to instantiate the chart.");
        return;
      }

      Control c;

      if ((c = Activator.CreateInstance(m_controlType) as Control) == null)
        return;

      ((IChartHolder)c).Chart.DataSource = m_dt;

      ShowForm sf = new ShowForm();

      sf.FormBorderStyle = FormBorderStyle.Sizable;
      sf.Text = c.Text;
      sf.ProcessLookFeel = false;
      sf.Create(c);

      sf.Show();
      sf.BringToFront();

      //.ShowForm.Show(c, FormBorderStyle.Sizable, null, m_title);
    }
Example #2
0
    public static ShowForm Show(Control c_,FormBorderStyle borderStyle_,Icon icon_, string title_)
    {
      ShowForm sf = new ShowForm();

      sf.FormBorderStyle = borderStyle_;
      sf.Text = title_;
      sf.Create(c_);
      sf.Icon = icon_;
      if (icon_ == null && c_ is IFormIconProvider)
        sf.Icon = ((IFormIconProvider)c_).FormIcon;
      else
        sf.Icon = DefaultIcon;

      sf.Show();
      sf.BringToFront();

      return sf;
    }
Example #3
0
    public static ShowForm ShowDialog(IWin32Window owner_, Control c_, FormBorderStyle borderStyle_, Icon icon, string title_)
    {
      ShowForm sf = new ShowForm {FormBorderStyle = borderStyle_, Text = title_, Icon = icon};

      sf.Create(c_);

      if (icon == null && c_ is IFormIconProvider)
        sf.Icon = ((IFormIconProvider)c_).FormIcon;
      else
        sf.Icon = DefaultIcon;

      sf.ShowDialog(owner_);
      sf.BringToFront();
      return sf;
    }