using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.Dynamics.Framework.UI.Extensibility; using Microsoft.Dynamics.Framework.UI.Extensibility.WinForms; using System.Drawing; namespace GOBInvisibleFields { [ControlAddInExport("GOB.NAV.InvisibleFields")] public class MyFieldPopupAddin : StringControlAddInBase, IControlAddInSite { protected override Control CreateControl() { TextBox control = new TextBox(); control.MinimumSize = new Size(50, 0); control.MaximumSize = new Size(300, Int32.MaxValue); control.BackColor = Color.LightBlue; control.Font = new Font("Tahoma", 9, FontStyle.Bold); return control; } } }
Answers
Ofcorse you need to declare your textbox out of the CreateControl() Method, otherwise you cant access the Control
And by the way: if you type "protected override" the intellisense shows you all virtual methods that you can grab to fill with your code...
now it works.