-1

So a few weeks ago I asked how to show all the forms in one screen and I got a great answer. The code that I use is in the link.

And then I discovered that it doesn't show the datebase and the buttons won't work and it's because I'm using a formPresenter to active the form and control the buttons.

class WorkerPresenter
{
    public frmWorker frmWorker;
    public WorkerPresenter()
    {
        frmWorker = new frmWorker();
        RegisterNotification(frmWorker);

        try
        {

            //frmWorker.ShowDialog();
            frmWorker.Show();
        }
        catch { }
        finally { }
    }

    public void RegisterNotification(frmWorker frmWorker)
    {
        frmWorker.DGVWorker.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(DGVWorker_RowHeaderMouseClick);
        frmWorker.Activated += new EventHandler(frmWorker_Activated);
        frmWorker.SearchWorkerB.Click += new EventHandler(SearchWorkerB_Click);
        frmWorker.ClearWorker.Click += new EventHandler(ClearWorker_Click);
        frmWorker.Clear2Worker.Click += new EventHandler(Clear2Worker_Click);
        frmWorker.LeftWorker.Click += new EventHandler(LeftWorker_Click);
        frmWorker.RightWorker.Click += new EventHandler(RightWorker_Click);
        frmWorker.ShowAllWorker.Click += new EventHandler(ShowAllWorker_Click);
        frmWorker.DeleteWorker.Click += new EventHandler(DeleteWorker_Click);
        frmWorker.DownWorker.Click += new EventHandler(DownWorker_Click);
        frmWorker.UpWorker.Click += new EventHandler(UpWorker_Click);
        frmWorker.AddWorker.Click += new EventHandler(AddWorker_Click);
        frmWorker.UpdateWorker.Click += new EventHandler(UpdateWorker_Click);
    }

I can send the full class if you need to.

And I wanted to know: can I integrate the formPresenter that I have to work with the code in the first link?

Community
  • 1
  • 1
hen shalom
  • 127
  • 1
  • 1
  • 9

1 Answers1

0

The answer which previously set is good to use. what is your need than? there are two ways to do this:

  1. Using mdimanager
  2. Using tabular control

when using mdi manager, all windows open in mainform which is mdiparent, not in a new form. when using tabular control, all windows add in this control instead a window.

do you seek third usage? you may be use a couple of code to demonstrate the usage or a screenshot of simple painting.

ferhatozkanun
  • 129
  • 1
  • 5