This project has moved and is read-only. For the latest updates, please go here.

Open to new trigger window

Apr 11, 2015 at 3:02 AM
Hi guys, I've been using the "EditorForm.Initialize" command to open the editor form, but is there a way to have it open directly into the triggers / new trigger form?

At the moment I've got the editor opening but it opens on the "general" tab, so the user then has to click the Triggers tab, then on New.

I'd much prefer if it opened directly to the new trigger window. Is that possible?
Apr 13, 2015 at 4:57 AM
Edited Apr 13, 2015 at 4:57 AM
There is not a simple property that will allow this. However you can use a sneaky method for doing this, though it has risks of internals breaking it in the future so definitely make sure you build in error handling.
using (TaskService mgr = new TaskService())
  var dlg = new TaskEditDialog(mgr.RootFolder.Tasks[0], false, false);
    TabControl tabs = dlg.Controls["taskPropertiesControl1"].Controls["tabControl"] as TabControl;
    TabPage triggerTab = dlg.Controls["taskPropertiesControl1"].Controls["tabControl"].Controls["triggersTab"] as TabPage;
    if (tabs != null && triggerTab != null)
      tabs.SelectedTab = triggerTab;
  catch { }
Marked as answer by dahall on 4/12/2015 at 8:58 PM
Apr 13, 2015 at 11:59 PM
Edited Apr 14, 2015 at 4:41 AM
thanks dahall, that opens the window directly into the "Triggers" tab which is great, but is it also possible to have it open to the "New Trigger" window - instead of having to press the "New" button?

Not a big problem as they could just press the button, but would be nice.

Thanks and appreciate your help,
Apr 14, 2015 at 4:23 PM
If you just need to create a new trigger, then use the TriggerEditDialog.
Marked as answer by dahall on 4/20/2015 at 8:13 AM