Search for file and literally "list buttons"

Discussion in 'Questions (Windows Mobile)' started by joel2009, Feb 23, 2009.

  1. joel2009

    joel2009 Member Licensed User

    I'm not exactly where to even start on this, i would like to search for a file type in a diretory (.txt) and list them, on click i need to be able to parse the text document.

    I know i will need the dirSearch, file read, and a binary object (and i guess some type of array from the example i saw) (i'm not very farmiliar with arrays at all though)..... but i don't know how to even list the objects in the first place.

    Can someone help point me in the right direction to get started?

    Thanks in advanced,

    Last edited: Feb 24, 2009
  2. N1c0_ds

    N1c0_ds Active Member Licensed User

    You can separate and parse the list with StrSplit (and all other String keywords). Then use For statements to repeat an action for each item in an array (using arraylength).

    Look in "keywords" in the help file. You will find a lot of info for what you are trying to do.
  3. joel2009

    joel2009 Member Licensed User

    Thanks Nick i'll take a look

    EDIT: By the way, I'm Getting ready to send you an email you need to see pertaining to your project so make sure you check it
  4. Erel

    Erel Administrator Staff Member Licensed User

    You should use FileSearch:
    FileSearch(ArrayList1, AppPath, "*.txt")
    This code will fill ArrayList1 with all the paths of txt files located in the current folder.
    Afterward you can add these to a listbox:
    For i = 0 to ArrayList1.Count - 1
    'Use FileName to omit the complete path
    Then you could catch ListBox_SelectionChanged event and use ArrayList1.Item(Index) to get the full path to the selected item.
  5. joel2009

    joel2009 Member Licensed User

    Thanks Erel worked like a charm Is there any way to add an image to the contol... or is only text allowed? I know the freewarepocketpc client some how add a screen shot but i looked as though it may be a seperate control? (I would like to actually use the image as a background for the buttons)
    Last edited: Feb 24, 2009
  6. N1c0_ds

    N1c0_ds Active Member Licensed User

    AddImage? You can add an image control with it. You can also toggle the Visible property to hide an image while not in use.
  7. joel2009

    joel2009 Member Licensed User

    you can use that to add the iamge to the list box? i was going to try and go for a list style similar to the layout i was using for jak portal
  8. N1c0_ds

    N1c0_ds Active Member Licensed User

    Oh. Uh. No.

    But you can make a panel within a panel. Say inpnl and outpnl. Add all the stuff required on inpnl, set its height and move it up and down with a scrollbar.

    This way you can display something similar to your PIE frame. The sad part is that you can't draw on a panel so you'll have to use less efficient methods such as addimage. Tell us more about what you want to do and I could give you a bit of code.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice