Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Forms.ComboBox

Forms.ComboBox

Scheduled Pinned Locked Moved C#
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yaakov77
    wrote on last edited by
    #1

    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.)

    M 1 Reply Last reply
    0
    • Y yaakov77

      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.)

      M Offline
      M Offline
      Michael Wolski
      wrote on last edited by
      #2

      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

      Y 1 Reply Last reply
      0
      • M Michael Wolski

        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

        Y Offline
        Y Offline
        yaakov77
        wrote on last edited by
        #3

        I've tried this approach, but when the form poppes up, thw hosting form is loosing focus. i.e. the caption color of the form changes to gray. In the combobox it stays blue even when it dropped down. What can the reason for this? Thanks for answering.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups