Un Dropping Down a Drop Down

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zacks@construction-imaging.com

    #1

    Un Dropping Down a Drop Down

    I have an application I am developing that has a Combo Box that is
    intended to show a list of available tables in the selected DSN. I
    have put code in the control's DropDown event handler to clear the
    item list and reload it from the currently specified DSN (in a Text
    Box control on the same form). This works well.

    BUT ... if the specified DSN is invalid, I can display an appropriate
    error message, but then then empty dropdown list is still displayed. I
    have tried to suppress it by setting the control's DroppedDown
    property to false if the error is encountered, but the empty dropdown
    list is still being displayed and I have to click on the dropdown
    button again to make it go away. What is also interesting is when I
    click on the dropdown button to make it go away, the DropDown event
    does not fire, only when it is first clicked.

    So, how do I un-drop down a drop down?

  • =?Utf-8?B?QWRyaWFuIFZvaWN1?=

    #2
    RE: Un Dropping Down a Drop Down


    If there is an error, you could just hide the drop down list to prevent the
    user from using it.

    Adrian.
    --
    [Please mark my answer if it was helpful to you]




    "zacks@construc tion-imaging.com" wrote:
    I have an application I am developing that has a Combo Box that is
    intended to show a list of available tables in the selected DSN. I
    have put code in the control's DropDown event handler to clear the
    item list and reload it from the currently specified DSN (in a Text
    Box control on the same form). This works well.
    >
    BUT ... if the specified DSN is invalid, I can display an appropriate
    error message, but then then empty dropdown list is still displayed. I
    have tried to suppress it by setting the control's DroppedDown
    property to false if the error is encountered, but the empty dropdown
    list is still being displayed and I have to click on the dropdown
    button again to make it go away. What is also interesting is when I
    click on the dropdown button to make it go away, the DropDown event
    does not fire, only when it is first clicked.
    >
    So, how do I un-drop down a drop down?
    >
    >

    Comment

    • =?Utf-8?B?VHJhY2tz?=

      #3
      RE: Un Dropping Down a Drop Down


      Maybe: ComboBox.Refres h


      "zacks@construc tion-imaging.com" wrote:
      I have an application I am developing that has a Combo Box that is
      intended to show a list of available tables in the selected DSN. I
      have put code in the control's DropDown event handler to clear the
      item list and reload it from the currently specified DSN (in a Text
      Box control on the same form). This works well.
      >
      BUT ... if the specified DSN is invalid, I can display an appropriate
      error message, but then then empty dropdown list is still displayed. I
      have tried to suppress it by setting the control's DroppedDown
      property to false if the error is encountered, but the empty dropdown
      list is still being displayed and I have to click on the dropdown
      button again to make it go away. What is also interesting is when I
      click on the dropdown button to make it go away, the DropDown event
      does not fire, only when it is first clicked.
      >
      So, how do I un-drop down a drop down?
      >
      >

      Comment

      • zacks@construction-imaging.com

        #4
        Re: Un Dropping Down a Drop Down

        On Jul 25, 11:32 pm, Tracks <Tra...@discuss ions.microsoft. comwrote:
        Maybe: ComboBox.Refres h
        Thenks, but it didn't help.
        >
        >
        >
        "za...@construc tion-imaging.com" wrote:
        I have an application I am developing that has a Combo Box that is
        intended to show a list of available tables in the selected DSN. I
        have put code in the control's DropDown event handler to clear the
        item list and reload it from the currently specified DSN (in a Text
        Box control on the same form). This works well.
        >
        BUT ... if the specified DSN is invalid, I can display an appropriate
        error message, but then then empty dropdown list is still displayed. I
        have tried to suppress it by setting the control's DroppedDown
        property to false if the error is encountered, but the empty dropdown
        list is still being displayed and I have to click on the dropdown
        button again to make it go away. What is also interesting is when I
        click on the dropdown button to make it go away, the DropDown event
        does not fire, only when it is first clicked.
        >
        So, how do I un-drop down a drop down?- Hide quoted text -
        >
        - Show quoted text -

        Comment

        • rowe_newsgroups

          #5
          Re: Un Dropping Down a Drop Down

          On Jul 26, 8:40 am, za...@construct ion-imaging.com wrote:
          On Jul 25, 11:32 pm, Tracks <Tra...@discuss ions.microsoft. comwrote:
          >
          Maybe: ComboBox.Refres h
          >
          Thenks, but it didn't help.
          >
          >
          >
          "za...@construc tion-imaging.com" wrote:
          I have an application I am developing that has a Combo Box that is
          intended to show a list of available tables in the selected DSN. I
          have put code in the control's DropDown event handler to clear the
          item list and reload it from the currently specified DSN (in a Text
          Box control on the same form). This works well.
          >
          BUT ... if the specified DSN is invalid, I can display an appropriate
          error message, but then then empty dropdown list is still displayed. I
          have tried to suppress it by setting the control's DroppedDown
          property to false if the error is encountered, but the empty dropdown
          list is still being displayed and I have to click on the dropdown
          button again to make it go away. What is also interesting is when I
          click on the dropdown button to make it go away, the DropDown event
          does not fire, only when it is first clicked.
          >
          So, how do I un-drop down a drop down?- Hide quoted text -
          >
          - Show quoted text -
          Alt + Down will toggle the drop down list up or down so you could
          experiment with either SendKeys.Send or even try using the SendMessage
          API to tell the combobox's handle to try to force the drop down to
          hide.

          Good Luck!

          Thanks,

          Seth Rowe

          Comment

          • Marc Gravell

            #6
            Re: Un Dropping Down a Drop Down

            IIRC, setting DroppedDown in the handler is too soon, and it doesn't
            work. You could try adding a delay, either using this.BeginInvok e, or
            a short timer?

            Marc

            Comment

            • zacks@construction-imaging.com

              #7
              Re: Un Dropping Down a Drop Down

              On Jul 26, 9:14 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
              On Jul 26, 8:40 am, za...@construct ion-imaging.com wrote:
              >
              >
              >
              >
              >
              On Jul 25, 11:32 pm, Tracks <Tra...@discuss ions.microsoft. comwrote:
              >
              Maybe: ComboBox.Refres h
              >
              Thenks, but it didn't help.
              >
              "za...@construc tion-imaging.com" wrote:
              I have an application I am developing that has a Combo Box that is
              intended to show a list of available tables in the selected DSN. I
              have put code in the control's DropDown event handler to clear the
              item list and reload it from the currently specified DSN (in a Text
              Box control on the same form). This works well.
              >
              BUT ... if the specified DSN is invalid, I can display an appropriate
              error message, but then then empty dropdown list is still displayed. I
              have tried to suppress it by setting the control's DroppedDown
              property to false if the error is encountered, but the empty dropdown
              list is still being displayed and I have to click on the dropdown
              button again to make it go away. What is also interesting is when I
              click on the dropdown button to make it go away, the DropDown event
              does not fire, only when it is first clicked.
              >
              So, how do I un-drop down a drop down?- Hide quoted text -
              >
              - Show quoted text -
              >
              Alt + Down will toggle the drop down list up or down so you could
              experiment with either SendKeys.Send or even try using the SendMessage
              API to tell the combobox's handle to try to force the drop down to
              hide.
              The Alt Down does work from the keyboard. So I put an:

              SendKeys.Send(" %{down}")

              in the DropDown event error branch, but alas, it does not appear to
              have any effect.

              It's almost like the dropdown occurs AFTER and user code in the
              DropDown event, and there is not a DroppedDown event to put code in to
              undrop it.

              ARGHHH!

              Comment

              Working...