static void Main(string[] args) { Console.WriteLine("Program 6"); var gr = new GroupBox(); //gr.InsertControl(0, new WindowlessControl()); //OK /* need this block(A) this to crash */ var item = new WindowlessControl(); new AlignPadLayoutPanel <WindowlessControl>().InsertControl(0, item); //OK if removed item.SetAttachedProperty(EDITING_TEXT, "label.Text"); /*end block(A)*/ gr.InsertControl(0, new WindowlessControl()); //NOT OK var wc = new WindowlessControl(); wc.SetAttachedProperty(EDITING_TEXT, "label.Text"); var str = wc.GetAttachedProperty(EDITING_TEXT); Console.WriteLine("DONE"); }
public void InsertControl(int index, WindowlessControl control) { OnControlAdded(new AxControlEventArgs(control)); }