Combo Box Change

This is a discussion on Combo Box Change within the Windows Programming forums, part of the Platform Specific Boards category; I have a combo box with an OnChange Event that works fine the first time through, but I would like ...

  1. #1
    Unregistered
    Guest

    Question Combo Box Change

    I have a combo box with an OnChange Event that works fine the first time through, but I would like to let the user make another choice without closing and reloading the program. I have a message box coming up and after the message box is closed the focus is set to the combo box, but I can't seem to get the OnChange Event to fire again. How do I force the OnChange Event to fire again? Do I have to use a pointer to the component? Please help me!! If you could post a code snippet I would appreciate it, or e-mail me at lgurney@davidson-instruments.com. Thanks!!!!!

  2. #2
    Davros
    Guest
    I presume you are using Borland C++ Builder. If you are are you can change which control has focus by using the forms SetFocus ActiveControl property.

    I think you need to be more explicit. The isn't enough information to answer your question properly.

  3. #3
    Unregistered
    Guest

    Post More Info. lgurney

    I am using Borland C++ Builder 5, and I have already set focus after the message box closes, but I can't seem to get the OnChange Event to fire again (to replace the ItemIndex property with a new value). Thank you for posting a reply!!!!

  4. #4
    Davros
    Guest
    I'm still not clear on the problem you're having -- I don't understand why your program closes after the user has made a selection.

    I've never had a problem with the OnChange event. It fires when the user changes the contents in the ComboBox, not when it receives focus. If this is what you're trying to do, you will find that it fires once when you first set the ItemIndex. If you want an event for when it receives focus, use OnEnter.

    If you're still having problems, place some code snippets in your reply and I'll have a look.

  5. #5
    Unregistered
    Guest

    lgurney:Fixed Combo Box Change

    I fixed the problem. The OnChange Event didn't work, but I was able to get the OnClick Event to work. The user wasn't changing the text in the combo box, instead they use the arrow on the combo box to choose the new item (although in the description of the OnChange Event it says that either a text change or choosing another item causes it to fire). Anyway, I got it to work.

    Thanks again!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. adding font to a list box or combo box
    By supernater in forum Windows Programming
    Replies: 2
    Last Post: 03-13-2009, 06:53 AM
  2. Problem with Combo Box
    By Jaken Veina in forum Windows Programming
    Replies: 4
    Last Post: 01-16-2009, 01:05 PM
  3. Combo Box Problem
    By osal in forum Windows Programming
    Replies: 1
    Last Post: 06-06-2004, 05:45 PM
  4. Best way to load lines of text from a file to a combo box
    By ganonl in forum Windows Programming
    Replies: 6
    Last Post: 04-15-2004, 12:07 PM
  5. SkyLock tech demo (GUI - DX combo box)
    By jdinger in forum Game Programming
    Replies: 4
    Last Post: 07-14-2002, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21