Forms.ComboBox
-
I'm building some Control that displays a form that let's me do some operations. (like the combobox, datetimepicker, etc.) Now, I nees that the poped area will be on top of all windows like the regular ComboBox dropped region, and wouldn't be trimmed by the parent control rectangle. What is the currect technique for this? (Sorry about my terrible English, I'm not an american.)
-
I'm building some Control that displays a form that let's me do some operations. (like the combobox, datetimepicker, etc.) Now, I nees that the poped area will be on top of all windows like the regular ComboBox dropped region, and wouldn't be trimmed by the parent control rectangle. What is the currect technique for this? (Sorry about my terrible English, I'm not an american.)
One approach would be to... Make the popped-up area a parentless, topmost Form that holds whatever custom control you wish. You can initialize it something like: protected void InitMyPoppedForm { ... this.TopMost = true; this.Deactivate += new System.EventHandler(this.MyPoppedForm_Deactivate); ... } Then you need to handle the Form's deactivate event, which fires when the user clicks anywhere else other than inside the MyPoppedForm. At the very least this should simply close the popped up form (like a combobox "rolls up" when it loses focus). Something like: private void MyPoppedForm_Deactivate(object sender, System.EventArgs e) { Hide(); NotifySomeoneILostFocus(); } Hope that helps. Michael Developer, Author, Chef
-
One approach would be to... Make the popped-up area a parentless, topmost Form that holds whatever custom control you wish. You can initialize it something like: protected void InitMyPoppedForm { ... this.TopMost = true; this.Deactivate += new System.EventHandler(this.MyPoppedForm_Deactivate); ... } Then you need to handle the Form's deactivate event, which fires when the user clicks anywhere else other than inside the MyPoppedForm. At the very least this should simply close the popped up form (like a combobox "rolls up" when it loses focus). Something like: private void MyPoppedForm_Deactivate(object sender, System.EventArgs e) { Hide(); NotifySomeoneILostFocus(); } Hope that helps. Michael Developer, Author, Chef