Page 1 of 1

Launching my own form from menu

PostPosted: Tue Apr 15, 2025 1:33 pm
by DannyC
Sort of related to thread viewtopic.php?f=26&t=2492 but a different tangent, so appropriate for a new thread.

In the above question, I was firing the custom form from a ribbon button which works nicely.

If I want to launch it from a menu, say under Debtors, Utilites how can I do that?
I know about adding it to the Forms, then adding it to the menu but my question is...

Using the sample plugin Launch App which launches Notepad, I can see the partial class inheriting the sales order Process screen. But it doesn't actually open the Process screen - it launches Notepad. Got it & have found that if I disable the public override code, the Process window displays but is blank.
All good there.

How can I populate the Process window with my own controls, say text boxes, labels, buttons etc?
Should I use Infragistics controls instead?

I've done the attached plugin based off Launch App and I am trying to populate the Process window with my controls.
And I also want to know how to fire some code when the user clicks the Process button.

Re: Launching my own form from menu  Topic is solved

PostPosted: Tue Apr 15, 2025 1:36 pm
by Mike.Sheen
Take a look in demo data at the plugin Debtor Export to CSV - it creates a form which is launchable from the menu.

Re: Launching my own form from menu

PostPosted: Tue Apr 15, 2025 2:20 pm
by SBarnes
The fundamental issue is there is no code in the plugin adding the controls to the control collection of any of controls Client Area on the form such as the code below, I've given him an example off line of the designer and class files with a couple of controls dropped on a ProcessAction form that I created in visual studio and some explanation that hopefully is enough to get him started.

Code: Select all
            this.upMain = new Infragistics.Win.Misc.UltraPanel();
            this.ultraTextEditor1 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
            this.ultraButton1 = new Infragistics.Win.Misc.UltraButton();
            this.ultraButton2 = new Infragistics.Win.Misc.UltraButton();
            this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();

            this.UserInterface_Fill_Panel.ClientArea.Controls.Add(this.upMain);
            this.upMain.ClientArea.Controls.Add(this.ultraLabel1);
            this.upMain.ClientArea.Controls.Add(this.ultraButton2);
            this.upMain.ClientArea.Controls.Add(this.ultraButton1);
            this.upMain.ClientArea.Controls.Add(this.ultraTextEditor1);
            this.upMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.upMain.Location = new System.Drawing.Point(0, 0);
            this.upMain.Name = "upMain";
            this.upMain.Size = new System.Drawing.Size(592, 358);
            this.upMain.TabIndex = 1;


Re: Launching my own form from menu

PostPosted: Tue Apr 15, 2025 6:14 pm
by DannyC
With information gleaned from the Debtor Export to CSV plugin, and the code that Stuart presented (outside this forum thread) I've been able to knock up a very simple example which I think I should be able to expand on.

It displays a label, a text box which I am populating from one of the buttons.
I've also worked out how to fire some code off the Process button - albeit just a simple messagebox.

If anyone cares to peruse and critique, plugin attached.