Lesen von .txt Datei und trennen

  • VB.NET
  • .NET (FX) 4.0

Es gibt 181 Antworten in diesem Thema. Der letzte Beitrag () ist von Lightsource.

    Momentan den zweiten. Sobald Du einen RadioButton anwählst, muss in dessen CheckedChangedEventHandler die ItemListe geleert und mit den Items der gewählten Rolle gefüllt werden.
    Eh … Moment. Das passiert ja schon, wenn ich mir Post#136 anschaue. Ist dieser Methoden-Aufbau bei allen RadioButtons prinzipiell gleich? Dann sollte es auch keine Probleme mit der Auswahl geben, da ja beim Anklicken der RollenRadioButtons die dazugehörige Datei geladen und in die ItemComboBox und die EQAAdventurer-Liste geschrieben werden. Hm …
    Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von „VaporiZed“, mal wieder aus Grammatikgründen.

    Aufgrund spontaner Selbsteintrübung sind all meine Glaskugeln beim Hersteller. Lasst mich daher bitte nicht den Spekulatiusbackmodus wechseln.

    VaporiZed schrieb:

    EQAAdventurer-Liste

    Das ist nicht ganz korrekt.
    Jede Klasse ist einzeln.

    VB.NET-Quellcode

    1. 'Make EQAAdventurer "Public" to use
    2. Private ReadOnly EQAAdventurer As New List(Of String)
    3. Private Sub GunaRadioButton_EQAAdventurer_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAAdventurer.CheckedChanged
    4. CreateNewCommandText()
    5. 'Read File & Split EQAAdventurer
    6. Dim lines() = System.IO.File.ReadAllLines("Files\EQArmours\Adventurer.txt")
    7. EQAAdventurer.Clear()
    8. ComboBox_EQAItem.Items.Clear()
    9. TextBox_EQACommand.Clear()
    10. For Each line In lines
    11. Dim parts() = line.Split(","c)
    12. ComboBox_EQAItem.Items.Add(parts(0))
    13. EQAAdventurer.Add(parts(1))
    14. Next
    15. ComboBox_EQAItem.SelectedIndex = -1
    16. ComboBox_EQARarity.SelectedIndex = 2
    17. ComboBox_EQAUpgrade.SelectedIndex = 0
    18. '<<<------>>>
    19. GunaImageButton_ClipEQA.Visible = False
    20. End Sub
    21. 'Make EQASwordsman "Public" to use
    22. Private ReadOnly EQASwordsman As New List(Of String)
    23. Private Sub GunaRadioButton_EQASwordsman_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQASwordsman.CheckedChanged
    24. CreateNewCommandText()
    25. 'Read File & Split EQASwordsman
    26. Dim lines() = System.IO.File.ReadAllLines("Files\EQArmours\Swordsman.txt")
    27. EQASwordsman.Clear()
    28. ComboBox_EQAItem.Items.Clear()
    29. TextBox_EQACommand.Clear()
    30. For Each line In lines
    31. Dim parts() = line.Split(","c)
    32. ComboBox_EQAItem.Items.Add(parts(0))
    33. EQASwordsman.Add(parts(1))
    34. Next
    35. ComboBox_EQAItem.SelectedIndex = -1
    36. ComboBox_EQARarity.SelectedIndex = 2
    37. ComboBox_EQAUpgrade.SelectedIndex = 0
    38. '<<<------>>>
    39. GunaImageButton_ClipEQA.Visible = False
    40. End Sub
    41. 'Make EQAArcher "Public" to use
    42. Private ReadOnly EQAArcher As New List(Of String)
    43. Private Sub GunaRadioButton_EQAArcher_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAArcher.CheckedChanged
    44. CreateNewCommandText()
    45. 'Read File & Split EQAAdventurer
    46. Dim lines() = System.IO.File.ReadAllLines("Files\EQArmours\Archer.txt")
    47. EQAArcher.Clear()
    48. ComboBox_EQAItem.Items.Clear()
    49. TextBox_EQACommand.Clear()
    50. For Each line In lines
    51. Dim parts() = line.Split(","c)
    52. ComboBox_EQAItem.Items.Add(parts(0))
    53. EQAArcher.Add(parts(1))
    54. Next
    55. ComboBox_EQAItem.SelectedIndex = -1
    56. ComboBox_EQARarity.SelectedIndex = 2
    57. ComboBox_EQAUpgrade.SelectedIndex = 0
    58. '<<<------>>>
    59. GunaImageButton_ClipEQA.Visible = False
    60. End Sub
    61. 'Make EQAMage "Public" to use
    62. Private ReadOnly EQAMage As New List(Of String)
    63. Private Sub GunaRadioButton_EQAMage_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAMage.CheckedChanged
    64. CreateNewCommandText()
    65. 'Read File & Split EQAAdventurer
    66. Dim lines() = System.IO.File.ReadAllLines("Files\EQArmours\Mage.txt")
    67. EQAMage.Clear()
    68. ComboBox_EQAItem.Items.Clear()
    69. TextBox_EQACommand.Clear()
    70. For Each line In lines
    71. Dim parts() = line.Split(","c)
    72. ComboBox_EQAItem.Items.Add(parts(0))
    73. EQAMage.Add(parts(1))
    74. Next
    75. ComboBox_EQAItem.SelectedIndex = -1
    76. ComboBox_EQARarity.SelectedIndex = 2
    77. ComboBox_EQAUpgrade.SelectedIndex = 0
    78. '<<<------>>>
    79. GunaImageButton_ClipEQA.Visible = False
    80. End Sub
    81. 'Make EQAMartialArtist "Public" to use
    82. Private ReadOnly EQAMartialArtist As New List(Of String)
    83. Private Sub GunaRadioButton_EQAMartialArtist_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAMartialArtist.CheckedChanged
    84. CreateNewCommandText()
    85. 'Read File & Split EQAAdventurer
    86. Dim lines() = System.IO.File.ReadAllLines("Files\EQArmours\Martial Artist.txt")
    87. EQAMartialArtist.Clear()
    88. ComboBox_EQAItem.Items.Clear()
    89. TextBox_EQACommand.Clear()
    90. For Each line In lines
    91. Dim parts() = line.Split(","c)
    92. ComboBox_EQAItem.Items.Add(parts(0))
    93. EQAMartialArtist.Add(parts(1))
    94. Next
    95. ComboBox_EQAItem.SelectedIndex = -1
    96. ComboBox_EQARarity.SelectedIndex = 2
    97. ComboBox_EQAUpgrade.SelectedIndex = 0
    98. '<<<------>>>
    99. GunaImageButton_ClipEQA.Visible = False
    100. End Sub
    Moin @MrSKY ich misch mich mal kurz ein :)
    Schreib das lieber so:

    VB.NET-Quellcode

    1. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Adventurer.txt")

    also mit Typ-Angabe. Ist einfacher zu lesen. Und vorher kannst du prüfen, ob die Datei existiert.

    VB.NET-Quellcode

    1. Private Sub B2_Click(sender As Object, e As EventArgs) Handles B2.Click
    2. CreateNewCommandText()
    3. 'Read File & Split EQAAdventurer
    4. If Not System.IO.File.Exists("Files\EQArmours\Adventurer.txt") Then
    5. MessageBox.Show("Die Datei »Files\EQArmours\Adventurer.txt« wurde nicht gefunden.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error)
    6. Return
    7. End If
    8. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Adventurer.txt")
    9. '....
    10. End Sub


    und hier auch mit Typ:

    For Each line As String In lines
    Dim parts As String() = line.Split(","c)
    ComboBox_EQAItem.Items.Add(parts(0))
    EQAAdventurer.Add(parts(1))
    Next

    Bartosz schrieb:

    Und mit Typendeklaration ist er einfacher zu lesen

    Ist Ansichtssache.
    Ich finde es übersichtlicher ohne.

    Aber vor allem, wenn du aus deinem String-Array mal eine List(Of String) machen willst, hast du mehrere Änderungen und ich nur eine.
    Typsicher sind beide Varianten.
    Insofern: Jeder wie er mag.
    --
    If Not Program.isWorking Then Code.Debug Else Code.DoNotTouch
    --
    ich komme langsam auf die Idee: Für Anfänger ist nützlich, die Typen noch hinzuschreiben.
    Mit der Zeit weiss man aber, dass zB. String.Split() String() zurückgibt, und weiss auch, was das(String()) ist.
    Und man hat gelernt, solch im Zweifelsfalle in 3 Sekunden nachzugucken: Video-Tut: Welchen Datentyp hat das Objekt?
    Dann wird wichtiger, dass man seine Zeilen kurz hat, und dass man Datentypen einfach umändern kann, ohne an mehreren Stellen nachbessern zu müssen.
    @MrSKY: Dann must Du eben in der CreateNewCommandText mithilfe eines If-Blocks (oder alternativ Select Case Block) schauen, welcher RadioButton gewählt ist und dann eben in CommandText den entsprechenden Eintrag aus der jeweiligen Rollenliste entnehmen. Also so ungefähr:

    VB.NET-Quellcode

    1. Dim CommandText = "$ci "
    2. Select Case True
    3. Case GunaRadioButton_EQAAdventurer.Checked: CommandText &= EQAAdventurer(ComboBox_EQAItem.SelectedIndex)
    4. Case GunaRadioButton_EQASwordsman.Checked: CommandText &= EQASwordsman(ComboBox_EQAItem.SelectedIndex)

    Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von „VaporiZed“, mal wieder aus Grammatikgründen.

    Aufgrund spontaner Selbsteintrübung sind all meine Glaskugeln beim Hersteller. Lasst mich daher bitte nicht den Spekulatiusbackmodus wechseln.
    Na sehr schön. Die Zeile, in der der Fehler auftritt, ist auf dem Screenshot nicht mehr zu sehen. :|
    Welchen Wert hat ComboBox_EQAItem.SelectedIndex? Wieviele Einträge hat EQASwordsman?
    Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von „VaporiZed“, mal wieder aus Grammatikgründen.

    Aufgrund spontaner Selbsteintrübung sind all meine Glaskugeln beim Hersteller. Lasst mich daher bitte nicht den Spekulatiusbackmodus wechseln.
    @MrSKY: Schau Dir bitte nochmal Deinen Post#142 an und zwar, wann Du beim Click der RadioButtons die CreateNewCommandText-Sub aufrufst. Dann dürfte klar werden, warum Dir das um die Ohren fliegt.
    Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von „VaporiZed“, mal wieder aus Grammatikgründen.

    Aufgrund spontaner Selbsteintrübung sind all meine Glaskugeln beim Hersteller. Lasst mich daher bitte nicht den Spekulatiusbackmodus wechseln.

    VaporiZed schrieb:

    wann Du beim Click der RadioButtons die CreateNewCommandText-Sub aufrufst


    VB.NET-Quellcode

    1. 'Make EQAAdventurer "Public" to use
    2. Private ReadOnly EQAAdventurer As New List(Of String)
    3. Private Sub GunaRadioButton_EQAAdventurer_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAAdventurer.CheckedChanged
    4. 'Read File & Split EQAAdventurer
    5. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Adventurer.txt")
    6. EQAAdventurer.Clear()
    7. ComboBox_EQAItem.Items.Clear()
    8. TextBox_EQACommand.Clear()
    9. For Each line As String In lines
    10. Dim parts As String() = line.Split(","c)
    11. ComboBox_EQAItem.Items.Add(parts(0))
    12. EQAAdventurer.Add(parts(1))
    13. Next
    14. ComboBox_EQAItem.SelectedIndex = -1
    15. ComboBox_EQARarity.SelectedIndex = 2
    16. ComboBox_EQAUpgrade.SelectedIndex = 0
    17. '<<<------>>>
    18. CreateNewCommandText()
    19. GunaImageButton_ClipEQA.Visible = False
    20. End Sub


    Hab das nun unten eingefügt anstatt oben.

    Dennoch löst es leider das Problem nicht.
    Nun liest er wenigstens die richtige .txt ein und wenn man diese auswählt kommt auch die richtige "ID" in die TextBox.
    Jedoch auch nur die ersten 6 Einträge und auch nur nachdem ich Adventurer ausgewählt habe.
    Wenn ich bei Programmstart Swordsman auswähle passiert gar nichts.
    Bitte die aktuelle Version der Private Sub GunaRadioButton_EQASwordsman_CheckedChanged und der CreateNewCommandText() posten. Würde mich nicht wundern, wenn sich da ein Flüchtigkeitsfehler eingeschlichen hat. Zur Sicherheit auch noch einen Screenshot mit der Ausgabe wie in Posts#151. Wie Du gemerkt hast, können solche Ausgaben die Fehlersuche schnell das Problem/Ziel eingrenzen.
    Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von „VaporiZed“, mal wieder aus Grammatikgründen.

    Aufgrund spontaner Selbsteintrübung sind all meine Glaskugeln beim Hersteller. Lasst mich daher bitte nicht den Spekulatiusbackmodus wechseln.

    VaporiZed schrieb:

    Private Sub GunaRadioButton_EQASwordsman_CheckedChanged


    VB.NET-Quellcode

    1. 'Make EQASwordsman "Public" to use
    2. Private ReadOnly EQASwordsman As New List(Of String)
    3. Private Sub GunaRadioButton_EQASwordsman_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQASwordsman.CheckedChanged
    4. 'Read File & Split EQASwordsman
    5. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Swordsman.txt")
    6. EQASwordsman.Clear()
    7. ComboBox_EQAItem.Items.Clear()
    8. TextBox_EQACommand.Clear()
    9. For Each line As String In lines
    10. Dim parts As String() = line.Split(","c)
    11. ComboBox_EQAItem.Items.Add(parts(0))
    12. EQASwordsman.Add(parts(1))
    13. Next
    14. ComboBox_EQAItem.SelectedIndex = -1
    15. ComboBox_EQARarity.SelectedIndex = 2
    16. ComboBox_EQAUpgrade.SelectedIndex = 0
    17. '<<<------>>>
    18. CreateNewCommandText()
    19. GunaImageButton_ClipEQA.Visible = False
    20. End Sub




    btw


    Wenn ich den Haltepunkt eins darunter setze und bei Programmstart Swordsman auswähle passiert nichts.
    Der kommt da gar nicht vorbei.
    Mir fällt grad ein: Setz mal in jeder RadioButton_CheckedChanged-Methode zu Beginn noch ne Startbedingung:

    VB.NET-Quellcode

    1. Private Sub GunaRadioButton_EQAAdventurer_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAAdventurer.CheckedChanged
    2. If Not GunaRadioButton_EQAAdventurer.Checked Then Return
    3. '…
    4. Private Sub GunaRadioButton_EQASwordsman_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQASwordsman.CheckedChanged
    5. If Not GunaRadioButton_EQASwordsman.Checked Then Return
    6. 'usw.

    Denn sonst werden die ganzen Methoden auch ausgeführt, wenn der jeweilige RadioButton seine Selektion (den Auswahlpunkt) verliert.
    Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von „VaporiZed“, mal wieder aus Grammatikgründen.

    Aufgrund spontaner Selbsteintrübung sind all meine Glaskugeln beim Hersteller. Lasst mich daher bitte nicht den Spekulatiusbackmodus wechseln.
    An der Stelle kann ich wohl nicht weiterhelfen. Du musst wohl alles Schritt für Schritt durchgehen, notfalls überall dort Haltepunkte setzen, wo Du der Meinung bist, dass der Compiler vorbeikommen muss. Und wenn er irgendwo anders abbiegt, dann schauen, warum.
    Ich hab den bisherigen Code für Adventurer und Swordsman genommen und ausprobiert. Klappt, siehe Screenshot (auch wenn die ItemDaten und der CommandText inhaltlich sicherlich nicht zu Deinem Spiel passen).
    Da Du den Inhalt der Form1.vb nicht posten willst, ist erstmal an dieser Stelle bei mir Schluss, da ich auf Anhieb nicht mehr wüsste, woran es liegen kann.
    Bilder
    • Result.png

      24,31 kB, 691×512, 18 mal angesehen
    Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von „VaporiZed“, mal wieder aus Grammatikgründen.

    Aufgrund spontaner Selbsteintrübung sind all meine Glaskugeln beim Hersteller. Lasst mich daher bitte nicht den Spekulatiusbackmodus wechseln.

    VaporiZed schrieb:

    Da Du den Inhalt der Form1.vb nicht posten willst


    Die hat über 2000 Zeilen Code.
    Nur um diese Funktion wo du mir hilfst ist nur dieser Part:

    VB.NET-Quellcode

    1. 'Make EQAAdventurer "Public" to use
    2. Private ReadOnly EQAAdventurer As New List(Of String)
    3. Private Sub GunaRadioButton_EQAAdventurer_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAAdventurer.CheckedChanged
    4. If Not GunaRadioButton_EQAAdventurer.Checked Then Return
    5. 'Read File & Split EQAAdventurer
    6. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Adventurer.txt")
    7. EQAAdventurer.Clear()
    8. ComboBox_EQAItem.Items.Clear()
    9. TextBox_EQACommand.Clear()
    10. For Each line As String In lines
    11. Dim parts As String() = line.Split(","c)
    12. ComboBox_EQAItem.Items.Add(parts(0))
    13. EQAAdventurer.Add(parts(1))
    14. Next
    15. ComboBox_EQAItem.SelectedIndex = -1
    16. ComboBox_EQARarity.SelectedIndex = 2
    17. ComboBox_EQAUpgrade.SelectedIndex = 0
    18. '<<<------>>>
    19. CreateNewCommandText()
    20. GunaImageButton_ClipEQA.Visible = False
    21. End Sub
    22. Private Sub ComboBox_EQAItem_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox_EQAItem.SelectedIndexChanged
    23. 'Get Entry EQAAdventurer from ComboBox and write in TextBox
    24. If (ComboBox_EQAItem.SelectedIndex >= EQAAdventurer.Count) Then
    25. Return
    26. End If
    27. '<<<------>>>
    28. CreateNewCommandText()
    29. End Sub
    30. Private Sub ComboBox_EQARarity_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox_EQARarity.SelectedIndexChanged
    31. 'Get Entry EQAAdventurer from ComboBox and write in TextBox
    32. If (ComboBox_EQAItem.SelectedIndex >= EQAAdventurer.Count) Then
    33. Return
    34. End If
    35. '<<<------>>>
    36. CreateNewCommandText()
    37. End Sub
    38. Private Sub ComboBox_EQAUpgrade_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox_EQAUpgrade.SelectedIndexChanged
    39. 'Get Entry EQAAdventurer from ComboBox and write in TextBox
    40. If (ComboBox_EQAItem.SelectedIndex >= EQAAdventurer.Count) Then
    41. Return
    42. End If
    43. '<<<------>>>
    44. CreateNewCommandText()
    45. End Sub
    46. 'Make EQASwordsman "Public" to use
    47. Private ReadOnly EQASwordsman As New List(Of String)
    48. Private Sub GunaRadioButton_EQASwordsman_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQASwordsman.CheckedChanged
    49. If Not GunaRadioButton_EQASwordsman.Checked Then Return
    50. 'Read File & Split EQASwordsman
    51. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Swordsman.txt")
    52. EQASwordsman.Clear()
    53. ComboBox_EQAItem.Items.Clear()
    54. TextBox_EQACommand.Clear()
    55. For Each line As String In lines
    56. Dim parts As String() = line.Split(","c)
    57. ComboBox_EQAItem.Items.Add(parts(0))
    58. EQASwordsman.Add(parts(1))
    59. Next
    60. ComboBox_EQAItem.SelectedIndex = -1
    61. ComboBox_EQARarity.SelectedIndex = 2
    62. ComboBox_EQAUpgrade.SelectedIndex = 0
    63. '<<<------>>>
    64. CreateNewCommandText()
    65. GunaImageButton_ClipEQA.Visible = False
    66. End Sub
    67. 'Make EQAArcher "Public" to use
    68. Private ReadOnly EQAArcher As New List(Of String)
    69. Private Sub GunaRadioButton_EQAArcher_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAArcher.CheckedChanged
    70. If Not GunaRadioButton_EQAArcher.Checked Then Return
    71. 'Read File & Split EQAAdventurer
    72. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Archer.txt")
    73. EQAArcher.Clear()
    74. ComboBox_EQAItem.Items.Clear()
    75. TextBox_EQACommand.Clear()
    76. For Each line As String In lines
    77. Dim parts As String() = line.Split(","c)
    78. ComboBox_EQAItem.Items.Add(parts(0))
    79. EQAArcher.Add(parts(1))
    80. Next
    81. ComboBox_EQAItem.SelectedIndex = -1
    82. ComboBox_EQARarity.SelectedIndex = 2
    83. ComboBox_EQAUpgrade.SelectedIndex = 0
    84. '<<<------>>>
    85. CreateNewCommandText()
    86. GunaImageButton_ClipEQA.Visible = False
    87. End Sub
    88. 'Make EQAMage "Public" to use
    89. Private ReadOnly EQAMage As New List(Of String)
    90. Private Sub GunaRadioButton_EQAMage_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAMage.CheckedChanged
    91. If Not GunaRadioButton_EQAMage.Checked Then Return
    92. 'Read File & Split EQAAdventurer
    93. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Mage.txt")
    94. EQAMage.Clear()
    95. ComboBox_EQAItem.Items.Clear()
    96. TextBox_EQACommand.Clear()
    97. For Each line As String In lines
    98. Dim parts As String() = line.Split(","c)
    99. ComboBox_EQAItem.Items.Add(parts(0))
    100. EQAMage.Add(parts(1))
    101. Next
    102. ComboBox_EQAItem.SelectedIndex = -1
    103. ComboBox_EQARarity.SelectedIndex = 2
    104. ComboBox_EQAUpgrade.SelectedIndex = 0
    105. '<<<------>>>
    106. CreateNewCommandText()
    107. GunaImageButton_ClipEQA.Visible = False
    108. End Sub
    109. 'Make EQAMartialArtist "Public" to use
    110. Private ReadOnly EQAMartialArtist As New List(Of String)
    111. Private Sub GunaRadioButton_EQAMartialArtist_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_EQAMartialArtist.CheckedChanged
    112. If Not GunaRadioButton_EQAMartialArtist.Checked Then Return
    113. 'Read File & Split EQAAdventurer
    114. Dim lines As String() = System.IO.File.ReadAllLines("Files\EQArmours\Martial Artist.txt")
    115. EQAMartialArtist.Clear()
    116. ComboBox_EQAItem.Items.Clear()
    117. TextBox_EQACommand.Clear()
    118. For Each line As String In lines
    119. Dim parts As String() = line.Split(","c)
    120. ComboBox_EQAItem.Items.Add(parts(0))
    121. EQAMartialArtist.Add(parts(1))
    122. Next
    123. ComboBox_EQAItem.SelectedIndex = -1
    124. ComboBox_EQARarity.SelectedIndex = 2
    125. ComboBox_EQAUpgrade.SelectedIndex = 0
    126. '<<<------>>>
    127. CreateNewCommandText()
    128. GunaImageButton_ClipEQA.Visible = False
    129. End Sub
    130. Private Sub CreateNewCommandText()
    131. If Not GunaRadioButton_EQAAdventurer.Checked AndAlso Not GunaRadioButton_EQASwordsman.Checked AndAlso Not GunaRadioButton_EQAArcher.Checked AndAlso Not GunaRadioButton_EQAMage.Checked AndAlso Not GunaRadioButton_EQAMartialArtist.Checked OrElse ComboBox_EQAItem.SelectedIndex = -1 OrElse ComboBox_EQARarity.SelectedIndex = -1 OrElse ComboBox_EQAUpgrade.SelectedIndex = -1 Then Return
    132. Dim CommandText = "$ci "
    133. Select Case True
    134. Case GunaRadioButton_EQAAdventurer.Checked : CommandText &= EQAAdventurer(ComboBox_EQAItem.SelectedIndex)
    135. Case GunaRadioButton_EQASwordsman.Checked : CommandText &= EQASwordsman(ComboBox_EQAItem.SelectedIndex)
    136. End Select
    137. If ComboBox_EQARarity.SelectedItem.ToString <> "0" Then
    138. CommandText &= " " & ComboBox_EQARarity.SelectedItem.ToString
    139. If ComboBox_EQAUpgrade.SelectedItem.ToString <> "0" Then CommandText &= " " & ComboBox_EQAUpgrade.SelectedItem.ToString
    140. ElseIf ComboBox_EQAUpgrade.SelectedItem.ToString <> "0" Then
    141. CommandText &= " 0 " & ComboBox_EQAUpgrade.SelectedItem.ToString
    142. End If
    143. TextBox_EQACommand.Text = CommandText
    144. End Sub
    145. Private Sub TextBox_EQACommand_TextChanged(sender As Object, e As EventArgs) Handles TextBox_EQACommand.TextChanged
    146. 'When Empty don't show Clipboard Icon
    147. If TextBox_EQACommand.Text = "" Then
    148. GunaImageButton_ClipEQA.Visible = False
    149. End If
    150. '<<<------>>>
    151. 'Show Clipboard Icon & Hide Checkmark Icon
    152. GunaImageButton_ClipEQA.Visible = True
    153. GunaImageButton_CheckmarkEQA.Visible = False
    154. '<<<------>>>
    155. End Sub