Results 1 to 14 of 14

Thread: ini file and listbox

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    158

    Re: ini file and listbox

    Quote Originally Posted by dglienna
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   Dim x As Integer, str$
    5.   For x = 0 To 3
    6.     List1.AddItem x * 7
    7.   Next x
    8.   For x = 0 To List1.ListCount - 1
    9.     str = str & List1.List(x) & ";"
    10.   Next x
    11.   MsgBox str
    12.   str = Left(str, Len(str) - 1)
    13.   MsgBox str
    14. End Sub
    im not understanding what that is for or where to put it, i did for forget to mention that i am taking info from one form and this is saved to the ini, then it can only be viewable on form2 which has the same setup and it all works but the only thing is that the listbox doesnt recieve all the info that is in the ini file

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ini file and listbox

    That's just the sample that I whipped up, which cut off a lot of the information when I used the MID() statement that you had, so I changed it around, then added the correction for your form.

    If you paste that code into a new project, and run it, you will see that it works correctly. All items are displayed.

    You can use Form2.Text1.text from Form1 to get the value.

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: ini file and listbox

    Quote Originally Posted by dglienna
    That's just the sample that I whipped up, which cut off a lot of the information when I used the MID() statement that you had, so I changed it around, then added the correction for your form.

    If you paste that code into a new project, and run it, you will see that it works correctly. All items are displayed.

    You can use Form2.Text1.text from Form1 to get the value.
    So does mine if you had bothered to try it.

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ini file and listbox

    I typed it in wrong. When I tried the mid statement, it messed up my data, so I used left. I added the ";" to the end, and removed it. You added ";" at the beginning of the data, and the Mid() would have worked.

    I assumed that Ch4s3t0ph3r did try it, though.

Posting Permissions

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



Click Here to Expand Forum to Full Width