Hi Scott
Whilst you suggestion is correct and I can get to the PictureContextMenuStrip that way it doesn't unfortunately help much in that its actually the setup before that would need to be used to get in before Jiwa and perform your own event and the control is null because the setup hasn't happened.
The code below does get the result though.
- Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
if(JiwaForm.GetType() == typeof(JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm))
{
JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm invform = (JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm)JiwaForm;
invform.DialogOpen.FileOk += openFileDialog_FileOk;
invform.DialogOpen.Tag = invform;
//System.Diagnostics.Debugger.Launch();
//System.Windows.Forms.MessageBox.Show(invform.Picture.ContextMenuStrip.Name);
}
}
private void openFileDialog_FileOk(object sender, System.ComponentModel.CancelEventArgs e)
{
System.Windows.Forms.OpenFileDialog dialog = (System.Windows.Forms.OpenFileDialog)sender;
JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm invform = (JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm)dialog.Tag;
//System.Windows.Forms.MessageBox.Show(dialog.FileName);
invform.Inventory.Aux4 = dialog.FileName;
//System.Windows.Forms.MessageBox.Show(invform.Inventory.Aux4);
}
Again thanks for the help.