public CustomFormRegion1(Outlook.FormRegion formRegion) : base(formRegion) { MSForms.UserForm form = formRegion.Form as MSForms.UserForm; _textBox1 = form.Controls["TextBox1"].To <Outlook.OlkTextBox>(); _commandButton1 = form.Controls["CommandButton1"].To <Outlook.OlkCommandButton>(); if (null != _commandButton1) { _commandButton1.ClickEvent += CommandButton1_ClickEvent; } }
public virtual void BeforeFormRegionShow(object formRegion) { try { FormRegion form = new Outlook.FormRegion(null, formRegion); OpenFormRegion openForm = OnCreateOpenFormRegion(form); if (null == openForm) { openForm = new OpenFormRegion(form); } openForm.Close += OpenForm_Close; OpenFormRegions.Add(openForm); OnFormRegionOpen(openForm); } catch (NetRuntimeSystem.Exception exception) { OnOutlookError(OutlookErrorMethodKind.BeforeFormRegionShow, exception); } }
public void BeforeFormRegionShow(Outlook.FormRegion FormRegion) { this.FormRegion = FormRegion; this.UserForm = FormRegion.Form as UserForm; System.Diagnostics.Debug.Write("BeforeFormRegionShow"); try { //System.Diagnostics.Debug.Write("BeforeFormRegionShow 1"); CommandButton1 = UserForm.Controls.Item("CommandButton1") as Outlook.OlkCommandButton; //System.Diagnostics.Debug.Write("BeforeFormRegionShow 2"); CommandButton1.Click += new Outlook.OlkCommandButtonEvents_ClickEventHandler(CommandButton1_Click); CommandButton2 = UserForm.Controls.Item("CommandButton2") as Outlook.OlkCommandButton; CommandButton2.Click += new Outlook.OlkCommandButtonEvents_ClickEventHandler(CommandButton2_Click); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public virtual void BeforeFormRegionShow(NetOffice.OutlookApi.FormRegion formRegion) { InvokerService.InvokeInternal.ExecuteMethod(this, "BeforeFormRegionShow", formRegion); }
protected override OpenFormRegion OnCreateOpenFormRegion(Outlook.FormRegion form) { return(new CustomFormRegion1(form)); }