void CreateDisposableButton(string e, Action a) { var btn = new IHTMLButton(e); this.Control.appendChild(btn); btn.onclick += delegate { a(); Control.Dispose(); }; }