Results 1 to 6 of 6

Thread: [Forms] ComboBox Event Handler

  1. #1
    Join Date
    Feb 2007
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [Forms] ComboBox Event Handler

    Hey

    I'M using a few ComboBoxes on my form and needed a OnSelect Event Handler.
    OnSelect is not available, but am wondering if maybe it has another name?

    Im currently using OnExit which does the job but you need to click away from the ComboBox. In my current setup, the next step after that ComboBox is the Script Start button. I need the Event to run before the script is started.

    I tried OnChange but it doesn't work for when a Item is Selected. It only works when something is typed into the ComboBox.

    Any Ideas on what I can do?

    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    I can only think of OnChange and OnDropDown
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  3. #3
    Join Date
    Feb 2007
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Tried OnChange and it works when typing in a value but not selecting a item.

    OnDropDown is Most Likely an Event that will run when the down arrow button is pressed.

    Now if there was an OnCloseDropDown or something along those lines it would work perfectly.

    I just found the bool to check if its dropped down.
    I'll use that and check if the menu is dropped then wait untill its not dropped and then put my code in there.

    Will post/edit results.


    Results---
    No luck with that.
    The DroppedDown bool kept coming in as False even though it was dropped down.


    Any more ideas?

  4. #4
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    Give me more details about what you are trying to do
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  5. #5
    Join Date
    Feb 2006
    Posts
    433
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If you want to see when a user has selected an item just use OnClick. To get the selected text use ComboBox.Text

  6. #6
    Join Date
    Feb 2007
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I would assume OnClick is when they click on the ComboBox.
    I need an event for when an item of the ComboBox has been changed.

    It should be OnChange but it doesn't work for item selection.

    SCAR Code:
    procedure TeleportUntilComboBox_Exit(senter: TObject);
    begin
      case TeleportUntilComboBox.Text of
        'Certain Level' : begin
                            AchieveLabel.Caption := 'Level To Achieve:';
                            AchieveEdit.Text := 'Enter Level to Teleport Until';
                            Teleportation.Height := 200;
                          end;
        'Certain XP'    : begin
                            AchieveLabel.Caption := 'XP To Achieve:';
                            AchieveEdit.Text := 'Enter XP to Teleport Until';
                            Teleportation.Height := 200;
                          end;
        'No More Runes' : begin
                            AchieveLabel.Caption := 'Level/XP To Achieve:';
                            AchieveEdit.Text := 'Enter Level/XP to Teleport Until';
                            Teleportation.Height := 200;
                            //change to 135 when figured out the OnSelect Handler problem
                          end
      end;
    end;

    Teleportation is a group box.
    If you want to see the form download my PowerTeleporter.
    Link is in my sig.

    The above code is not part of it as this is for my next version.

    Basically when a user selects case 1 or 2 an additional EDIT will come on to the screen so they get enter level/xp to achieve.
    If case 3, its not needed so it wont be viewable anymore.


    EDIT---------------------------------
    SPKY you just made my day.
    OnClick works just as I want.
    Thanks alot :P

    Mod please closed [Resolved]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [REQUEST] Lumbridge Stair Handler
    By benjaa in forum Research & Development Lounge
    Replies: 9
    Last Post: 05-07-2008, 01:00 PM
  2. My New Msn Handler
    By The Prince of Randomness? in forum News and General
    Replies: 9
    Last Post: 05-07-2006, 12:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •