Re: TreeView menu



For all which use google.
This is Simple class which allow popup menus:
public class TreeViewPopup : TreeView {
        public TreeViewPopup(Menu m) {
                this.m = m;
        }
        override protected bool OnButtonPressEvent(EventButton evnt) {
                bool ret = base.OnButtonPressEvent(evnt);
                if(EventType.ButtonPress.Equals(evnt.Type) &&
                   (evnt.Button == 3) &&
                   (m != null))
                        m.Popup(null, null, null, evnt.Button, evnt.Time);
                return ret;
        }
        
        private Menu DefaultMenu() {
                return m;
        }
        
        private Menu m;
}






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]