gljakal's ToDo - Plugin developer's reference

PluginBase.getAdditionalDetailControls Method 

[This is preliminary documentation and subject to change.]

Returns the additional controls to place on the detail form

public virtual Control[] getAdditionalDetailControls();

Return Value

An array of System.Windows.Forms.Control objects

Remarks

The additional controls returned should be instantiated as new at every call (IE as local variables inside this function)

When the user closes the detail window, a boolean value is returned in the Tag property of the control. It contains true if the user clicked [Ok], false if the user clicked [Cancel].
In order to handle correctly the ok/cancel scenario, you should perform your value saving routines inside the control's HandleDestroyed event, checking the Tag parameter of your control.

Example

The following example adds a new TextBox control in the details window and handles closing event

public override System.Windows.Forms.Control[] getAdditionalDetailControls()
{
    System.Windows.Forms.TextBox Textbox1 = new System.Windows.Forms.TextBox();
    Textbox1.Size = new System.Drawing.Size(100, 20);
    Textbox1.HandleDestroyed += new EventHandler(Textbox1_HandleDestroyed);
    return new System.Windows.Forms.Control[] { Textbox1 };
}

private void Textbox1_HandleDestroyed(object s, EventArgs e)
{
    System.Windows.Forms.TextBox Textbox1 = (System.Windows.Forms.TextBox)s;
    if((bool)Textbox1.Tag)
    {
        System.Windows.Forms.MessageBox.Show("You pressed ok");
    }
    else
    {
        System.Windows.Forms.MessageBox.Show("You pressed Cancel");
    }
}

See Also

PluginBase Class | ToDo.Plugin Namespace | getAdditionalControls