Mayzie12's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
New Members
Active Posts:
15 (0.03 per day)
Joined:
16-January 13
Profile Views:
122
Last Active:
User is offline Jan 18 2013 02:25 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   Mayzie12 has not set their status

Posts I've Made

  1. In Topic: Using XML for High Score Table

    Posted 18 Jan 2013

    Managed to sort it out! :)

    Put this code

    
            Dim theScores As New List(Of Scores)
    
            'MsgBox(score.ToString())
            For Each score As String In My.Settings.HighScores
                Dim values() As String = score.Split(";")
                theScores.Add(New Scores With {.Score = Int32.Parse(values(0)), .Name = values(1)})
            Next
    
    
            'add these to a form control
            For Each score As Scores In theScores.OrderByDescending(Function(aScore) aScore.Score)
                MsgBox(score.Score & score.Name)
                frm3.ListBox1.Items.Add(score.Score & " " & score.Name)
            Next
    
    
    


    Into the button click and it works. No duplicate names and scores and sorts them out perfectly.

    If i can get them to save its a winner and done!

    Thanks again for all your help

    Craig
  2. In Topic: Using XML for High Score Table

    Posted 18 Jan 2013

    Ah cheers, using the hide() solved it.

    I was noticing that once a score and name was added, the listbox displayed e.g. 10 craig

    but then if i added another name and score it would then show

    10 craig
    11james
    10craig

    So the first record would remain.

    I solved this with Listbox.items.clear(), So when i hit the return key on frm2 it clears the listbox.

    All i have done is created another problem as if you dont add another record the listbox remains empty because it is printing to the listbox when i add a score.

    So im guessing this comes back to the old problem of getting it so when it loads up frm2 it prints to the listbox?
  3. In Topic: Using XML for High Score Table

    Posted 18 Jan 2013

    I gave the saving a try and seems to be working. Bit intermittent but before i say anything ill have a proper look into so i dont end up wittering a lot of rubbish.

    frm2 is declared at the very top of the class. it works when i try to open it the first time, but then if i go back, add another name and score (I shut down frm2) then click on the button to open up frm 2 again thats when i get the error.

    I'm still testing it as it seems a bit sporadic for me at the moment.

    If i find anything certain i'll let you know.

    Thanks

    Craig
  4. In Topic: Using XML for High Score Table

    Posted 18 Jan 2013

    I gave it a shot, published the program and installed it, with the saving like this

            My.Settings.HighScores.Add(Userscore1.ToString() & ";" & Username1)
            My.Settings.HighScores.Add(Userscore2.ToString() & ";" & Username2)
            My.Settings.Save()
    
    


    Closed the program, re-opened it and they weren't there :/

    I really need to find the edit button......

    Just also found out.

    If i add a name to the table its fine,
    But then if i try to add another name it does not work and highlights

    frm2.show()

    Says it cannot handle a disposed object~?
  5. In Topic: Using XML for High Score Table

    Posted 18 Jan 2013

    Thats working perfectly thanks.

    So if i just put

    my.settings.save() after the code for adding the names and scores, it will save them permanantly?

    All that is needed now is to put a wee vbTab in between the printing on the scores and names and it will be perfect.

    Thanks a lot for your help, its been great.

    Craig

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Mayzie12 hasn't added any friends yet.

Comments

Mayzie12 has no profile comments yet. Why not say hello?