Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2007
    Location
    UK
    Posts
    73

    Prob with listboxes

    Hi!

    So I have about 4 or 5 list boxes in my app, 1-2 per page, which when shown populate from files just fine, but the prob I have is that whenever I navigate to different pages and then come back to them, they keep populating and I get a duplicate of what Ive already got.

    So to summarise: whenever I goto a different page and then back again, I have double the entries, 2 for each instead of 1.
    What do I need to do to make this not happen?

  2. #2
    Join Date
    Dec 2004
    Location
    Texas
    Posts
    239
    Try this:

    Code:
    nItemCount = ListBox.GetCount("ListBox1");
    if nItemCount ~= -1 and nItemCount ~= 0 then
    --insert action here
    else
    --insert action here
    end

  3. #3
    Join Date
    Aug 2003
    Posts
    2,427
    Not specific to your problem, it's what I do if I only want to see or hear things once. Set a variable when leaving a page and when going to the page, in the pre-load or on show check for it. If it's not there then you haven't been to the page before and need to run code else you have and don't run it.

  4. #4
    Join Date
    Sep 2007
    Location
    UK
    Posts
    73
    right, I officially have no idea on what you mean!

    Here is the current code:
    tblExtraApps = File.Find("AutoPlay\\Extra Apps", "*.exe", true, false)
    if tblExtraApps ~= nil then
    for i,v in tblExtraApps do
    tblSplitPath = String.SplitPath(v)
    ListBox.AddItem("ListBox1", tblSplitPath.Filename, v)
    end
    end
    which has worked for me before in the past.

    Also, here is a screenshot of my program so you can get a better idea of what it is.
    Attached Images

  5. #5
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020
    Hi,

    If your Page OnShow autopopulates the ListBox from a source, during application runtime your ListBox will be populated again everytime you enter it.

    What you need to do is to AUTODELETE whats listed in the ListBox everytime you enter using ListBox.DeleteItem("ListBox1", -1); and REPOPULATE it immediately from the same source you used earlier. Place both actions on the same Page OnShow.
    Newbie Examples
    ------> AMS 7.5 : amstudio.azman.info
    ----> AMS 6 & 5: www.azman.info/ams/
    ----> FB: facebook.com/GuideToWealth

    ----> Content Development Blog: www.AZMAN.asia

  6. #6
    Join Date
    Dec 2004
    Location
    Texas
    Posts
    239
    Code:
    nItemCount = ListBox.GetCount("ListBox1");
    if nItemCount ~= -1 and nItemCount ~= 0 then
    --insert action here
    else
    tblExtraApps = File.Find("AutoPlay\\Extra Apps", "*.exe", true, false)
    if tblExtraApps ~= nil then
    for i,v in tblExtraApps do
    tblSplitPath = String.SplitPath(v)
    ListBox.AddItem("ListBox1", tblSplitPath.Filename, v)
    end
    end
    end

  7. #7
    Join Date
    Sep 2007
    Location
    UK
    Posts
    73
    Thanks, this works perfectly!

    I have this sidebar at the end of the right hand side, how would I go about auto-hiding it and when I move the mouse to the right hand side, it would auto-show?

    this would be awesome!

  8. #8
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020
    Hi,

    You should test Worm's Pop-up plugin. If u like it, buy it.

    And use HOTSPOT object to call the plugin once the mouse passes thru an area you specified.
    Newbie Examples
    ------> AMS 7.5 : amstudio.azman.info
    ----> AMS 6 & 5: www.azman.info/ams/
    ----> FB: facebook.com/GuideToWealth

    ----> Content Development Blog: www.AZMAN.asia

Similar Threads

  1. Webpge login Prob
    By hildedragon in forum AutoPlay Media Studio 6.0
    Replies: 4
    Last Post: 04-19-2007, 02:08 AM
  2. prob getting table to combobox
    By Jonas DK in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 01-05-2007, 04:56 PM
  3. 2 Listboxes
    By AlexSugar in forum AutoPlay Media Studio 6.0
    Replies: 6
    Last Post: 11-05-2006, 07:18 AM
  4. Prob. Publish->Build Comp. Exc. Source Path
    By merc in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 08-13-2006, 11:27 AM
  5. Please help with listboxes and window visibility!
    By tomwrn in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 07-03-2003, 03:23 PM

Posting Permissions

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