InvalidOperationException

  • VB.NET

Es gibt 5 Antworten in diesem Thema. Der letzte Beitrag () ist von Alteran.

    InvalidOperationException

    Hi an alle,
    da in meinem letzen Thema mein Frage nicht beantwortet wurde, versuche ich es mit einem neuen Thema erneut.
    Nur habe ich diesmal ein anderes Problem.
    Wenn ich mein Programm debuggen möchte kommt folgende Fehlermeldung ohne das ich meine Form sehen kann:
    Fehler beim Erstellen des Formulars. Weitere Informationen finden Sie in Exception.InnerException. Fehler: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt..


    Hier mein kompletter Quellcode, ist zwar viel hilf aber weiter:

    VB.NET-Quellcode

    1. Public Class Form1
    2. Public Shared Lektion1Vok(12)
    3. Public Shared Lektion1Ant(12)
    4. Public Shared Lektion2Vok(26)
    5. Public Shared Lektion2Ant(26)
    6. Public Shared Lektion3Vok(25)
    7. Public Shared Lektion3Ant(25)
    8. Public Shared Er
    9. Public Shared ran2
    10. Public Shared Anzdr1 = 0
    11. Public Shared anz1 = 0
    12. Public Shared Lektion = 1
    13. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    14. Abfrage.Show()
    15. End Sub
    16. Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
    17. Lektion = ComboBox1.GetItemText(ComboBox1.SelectedItem).Remove(0, 8)
    18. FillListboxes()
    19. End Sub
    20. Sub FillListboxes()
    21. If Lektion = 1 Then
    22. For i As Integer = 0 To Lektion1Vok.Length
    23. RichTextBox1.AppendText(Lektion1Vok(i))
    24. Next
    25. End If
    26. End Sub
    27. Public Sub Gen()
    28. Lektion1Vok(0) = "basilica -ae f."
    29. Lektion1Ant(0) = "Markthalle , Gerichtshalle"
    30. Lektion1Vok(1) = "forum -i n."
    31. Lektion1Ant(1) = "Forum , Marktplatz"
    32. Lektion1Vok(2) = "monumentum -i n."
    33. Lektion1Ant(2) = "Denkmal"
    34. Lektion1Vok(3) = "statua -ae f."
    35. Lektion1Ant(3) = "Statue , Standbild"
    36. Lektion1Vok(4) = "templum -i n."
    37. Lektion1Ant(4) = "Tempel , heiliger Ort"
    38. Lektion1Vok(5) = "dominus -i m."
    39. Lektion1Ant(5) = "Hausherr , Herr"
    40. Lektion1Vok(6) = "domina -ae f."
    41. Lektion1Ant(6) = "Hausherrin , Herrin"
    42. Lektion1Vok(7) = "filius -i m."
    43. Lektion1Ant(7) = "Sohn"
    44. Lektion1Vok(8) = "filia -ae f."
    45. Lektion1Ant(8) = "Tochter"
    46. Lektion1Vok(9) = "servus -i m."
    47. Lektion1Ant(9) = "Sklave , Diener"
    48. Lektion1Vok(10) = "serva -ae f."
    49. Lektion1Ant(10) = "Sklavin , Dienerin"
    50. Lektion1Vok(11) = "Roma"
    51. Lektion1Ant(11) = "Rom"
    52. Lektion1Vok(12) = "forum Romanum"
    53. Lektion1Ant(12) = "Forum Romanum"
    54. Lektion2Vok(0) = "est"
    55. Lektion2Ant(0) = "er (sie, es) ist"
    56. Lektion2Vok(1) = "amicus -i m."
    57. Lektion2Ant(1) = "Freund"
    58. Lektion2Vok(2) = "amica -ae f."
    59. Lektion2Ant(2) = "Freundin"
    60. Lektion2Vok(3) = "et"
    61. Lektion2Ant(3) = "und, auch"
    62. Lektion2Vok(4) = "sunt"
    63. Lektion2Ant(4) = "sie sind"
    64. Lektion2Vok(5) = "hic"
    65. Lektion2Ant(5) = "hier"
    66. Lektion2Vok(6) = "ibi"
    67. Lektion2Ant(6) = "dort"
    68. Lektion2Vok(7) = "porta -ae f."
    69. Lektion2Ant(7) = "Tor"
    70. Lektion2Vok(8) = "iam"
    71. Lektion2Ant(8) = "nun, schon, bereits"
    72. Lektion2Vok(9) = "patet -eo"
    73. Lektion2Ant(9) = "er (sie, es) steht offen, erstreckt sich"
    74. Lektion2Vok(10) = "taberna -ae f."
    75. Lektion2Ant(10) = "Laden, Wirtshaus"
    76. Lektion2Vok(11) = "cur?"
    77. Lektion2Ant(11) = "warum?"
    78. Lektion2Vok(12) = "adest"
    79. Lektion2Ant(12) = "er (sie, es) ist da, hilft"
    80. Lektion2Vok(13) = "quid?"
    81. Lektion2Ant(13) = "was?"
    82. Lektion2Vok(14) = "videt -eo"
    83. Lektion2Ant(14) = "er (sie, es) sieht"
    84. Lektion2Vok(15) = "properat -o"
    85. Lektion2Ant(15) = "er (sie, es) eilt, beeilt sich"
    86. Lektion2Vok(16) = "gaudet -eo"
    87. Lektion2Ant(16) = "er (sie, es) freut sich"
    88. Lektion2Vok(17) = "salutat -o"
    89. Lektion2Ant(17) = "er (sie, es) (be)grüßt"
    90. Lektion2Vok(18) = "salve"
    91. Lektion2Ant(18) = "Sei gegrüßt! Guten Tag!"
    92. Lektion2Vok(19) = "salvete"
    93. Lektion2Ant(19) = "Seid gegrüßt! Guten Tag!"
    94. Lektion2Vok(20) = "nam"
    95. Lektion2Ant(20) = "denn, nämlich"
    96. Lektion2Vok(21) = "adsunt"
    97. Lektion2Ant(21) = "sie sind da, helfen"
    98. Lektion2Vok(22) = "sed"
    99. Lektion2Ant(22) = "aber, sondern"
    100. Lektion2Vok(23) = "non"
    101. Lektion2Ant(23) = "nicht"
    102. Lektion2Vok(24) = "cessat -o"
    103. Lektion2Ant(24) = "er (sie, es)zögert, rastet"
    104. Lektion2Vok(25) = "interrogat -o"
    105. Lektion2Ant(25) = "er (sie, es) fragt"
    106. Lektion2Vok(26) = "ubi?"
    107. Lektion2Ant(26) = "wo?"
    108. Lektion3Vok(0) = "curia -ae f."
    109. Lektion3Ant(0) = "Kurie"
    110. Lektion3Vok(1) = "nunc"
    111. Lektion3Ant(1) = "jetzt, nun"
    112. Lektion3Vok(2) = "senator -is m."
    113. Lektion3Ant(2) = "Senator"
    114. Lektion3Vok(3) = "intrat -o"
    115. Lektion3Ant(3) = "er (sie, es) betritt, tritt ein"
    116. Lektion3Vok(4) = "paulum"
    117. Lektion3Ant(4) = "ein wenig"
    118. Lektion3Vok(5) = "exspectat -o"
    119. Lektion3Ant(5) = "er (sie, es) wartet, erwartet"
    120. Lektion3Vok(6) = "prope"
    121. Lektion3Ant(6) = "in der Nähe, beinahe"
    122. Lektion3Vok(7) = "etiam"
    123. Lektion3Ant(7) = "auch, sogar"
    124. Lektion3Vok(8) = "mercator -is m."
    125. Lektion3Ant(8) = "Kaufmann, Händler"
    126. Lektion3Vok(9) = "sedet -eo"
    127. Lektion3Ant(9) = "er (sie, es) sitzt"
    128. Lektion3Vok(10) = "tacet -eo"
    129. Lektion3Ant(10) = "er (sie, es) schweigt, verschweigt"
    130. Lektion3Vok(11) = "nondum"
    131. Lektion3Ant(11) = "noch nicht"
    132. Lektion3Vok(12) = "laborat -o"
    133. Lektion3Ant(12) = "er (sie, es) arbeitet, strengt sich an"
    134. Lektion3Vok(13) = "populus -i m."
    135. Lektion3Ant(13) = "Volk, Volksmenge"
    136. Lektion3Vok(14) = "diu"
    137. Lektion3Ant(14) = "lange Zeit"
    138. Lektion3Vok(15) = "tandem"
    139. Lektion3Ant(15) = "endlich"
    140. Lektion3Vok(16) = "accedit -o kons."
    141. Lektion3Ant(16) = "er (sie, es) kommt herbei, kommt hinzu"
    142. Lektion3Vok(17) = "statim"
    143. Lektion3Ant(17) = "auf der Stelle, sofort"
    144. Lektion3Vok(18) = "clamat -o"
    145. Lektion3Ant(18) = "er (sie, es) ruft laut, schreit"
    146. Lektion3Vok(19) = "tum"
    147. Lektion3Ant(19) = "da, damals, dann, darauf"
    148. Lektion3Vok(20) = "quis?"
    149. Lektion3Ant(20) = "wer?"
    150. Lektion3Vok(21) = "mittit -o kons."
    151. Lektion3Ant(21) = "er (sie, es) lässt (los), schickt, wirft"
    152. Lektion3Vok(22) = "nemo"
    153. Lektion3Ant(22) = "niemand"
    154. Lektion3Vok(23) = "placet -eo"
    155. Lektion3Ant(23) = "er (sie, es) gefällt"
    156. Lektion3Vok(24) = "stat -o"
    157. Lektion3Ant(24) = "er (sie, es) steht"
    158. Lektion3Vok(25) = "ridet -eo"
    159. Lektion3Ant(25) = "er (sie, es) lacht , lacht aus"
    160. End Sub
    161. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    162. Gen()
    163. End Sub
    164. End Class


    Kann mir jemand sagen wo der Fehler liegt oder was ich falsch gemacht habe? Danke :thumbsup: