Hallo Leute,
ich bin jetzt echt verwundert weil mein Code nicht funktioniert und ich nicht weiß, wo der Fehler liegt.
Fehlerbeschreibung
Quellcode
Ist bestimmt ganz easy aber ich blicks gerade einfach nicht. Hoffe ihr könnt mir helfen!
Kurzer EDIT: VB-Tag eingefügt
ich bin jetzt echt verwundert weil mein Code nicht funktioniert und ich nicht weiß, wo der Fehler liegt.
System.InvalidOperationException wurde nicht behandelt.
HResult=-2146233079
Message=Die Liste, an die der Enumerator gebunden ist, wurde geändert. Ein Enumerator kann nur verwendet werden, wenn die Liste nicht geändert wird.
Source=System.Windows.Forms
StackTrace:
bei System.Windows.Forms.ListBox.ItemArray.EntryEnumerator.System.Collections.IEnumerator.MoveNext()
bei Skype_Bot_89_Helfer.Form1.Button2_Click(Object sender, EventArgs e) in D:\ClickProg\Skype Bot 89 Helfer\Skype Bot 89 Helfer\Form1.vb:Zeile 25.
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei Skype_Bot_89_Helfer.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:
HResult=-2146233079
Message=Die Liste, an die der Enumerator gebunden ist, wurde geändert. Ein Enumerator kann nur verwendet werden, wenn die Liste nicht geändert wird.
Source=System.Windows.Forms
StackTrace:
bei System.Windows.Forms.ListBox.ItemArray.EntryEnumerator.System.Collections.IEnumerator.MoveNext()
bei Skype_Bot_89_Helfer.Form1.Button2_Click(Object sender, EventArgs e) in D:\ClickProg\Skype Bot 89 Helfer\Skype Bot 89 Helfer\Form1.vb:Zeile 25.
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei Skype_Bot_89_Helfer.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:
VB.NET-Quellcode
- Public Class Form1
- Dim FertigText As String
- Dim Erstes As Integer = 0
- Const quote As String = """"
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- ListBox1.Items.Add(TextBox1.Text)
- TextBox1.Clear()
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- If CheckBox1.Checked = True Then
- FertigText = ""
- For Each Items In ListBox1.Items
- If Erstes = 1 Then
- FertigText = FertigText & (" or " & quote & Items.ToString & quote)
- ListBox1.Items.Remove(Items.ToString)
- Else
- FertigText = ("If msg.body.tolower = (""" & Items.ToString & """")
- ListBox1.Items.Remove(Items.ToString)
- Erstes = 1
- End If
- Next
- FertigText = FertigText & ")"
- MsgBox(FertigText)
- End If
- End Sub
- End Class
Ist bestimmt ganz easy aber ich blicks gerade einfach nicht. Hoffe ihr könnt mir helfen!
Kurzer EDIT: VB-Tag eingefügt