Hallo,
ich bräuchte bitte kurz Hilfe mit der Syntax, Ich erstelle aus einem anderen Thread ein Form, welches mit
Und das hier habe ich im Netz gefunden und versucht, auf meine Bedürfnisse anzupassen; das funktioniert auch nicht:
Ich habe bereits in Einzelschritten debuggt. Der Fehler ist tatsächlich in der Zeile mit Me.Invoke().
Hat sich erledigt :
ich bräuchte bitte kurz Hilfe mit der Syntax, Ich erstelle aus einem anderen Thread ein Form, welches mit
.Show()
aufgerufen werden soll. Leider funktioniert dieser Aufruf nicht:VB.NET-Quellcode
- If List_of_images_not_found.Count > 0 Then
- If Application.OpenForms.OfType(Of Form_of_not_found_images)().Count() = 1 Then
- Application.OpenForms.OfType(Of Form_of_not_found_images)().First().Close()
- End If
- Dim Fonfi As New Form_of_not_found_images
- 'Dim thisaction As Action(Of Form_of_not_found_images) = Sub()
- ' Fonfi.ShowData(List_of_images_not_found)
- ' Fonfi.Show()
- ' End Sub
- Me.Invoke(Sub() Fonfi.ShowData(List_of_images_not_found),
- Sub() Fonfi.Show())
- End If
Unbehandelte Ausnahme: System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.Reflection.TargetParameterCountException: Parameteranzahlkonflikt.
Und das hier habe ich im Netz gefunden und versucht, auf meine Bedürfnisse anzupassen; das funktioniert auch nicht:
VB.NET-Quellcode
- If List_of_images_not_found.Count > 0 Then
- If Application.OpenForms.OfType(Of Form_of_not_found_images)().Count() = 1 Then
- Application.OpenForms.OfType(Of Form_of_not_found_images)().First().Close()
- End If
- Dim Fonfi As New Form_of_not_found_images
- Dim thisaction As Action(Of Form_of_not_found_images) = Sub()
- Fonfi.ShowData(List_of_images_not_found)
- Fonfi.Show()
- End Sub
- Me.Invoke(thisaction)
- 'Me.Invoke(Sub() Fonfi.ShowData(List_of_images_not_found),
- ' Sub() Fonfi.Show())
- End If
Unbehandelte Ausnahme: System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.Reflection.TargetParameterCountException: Parameteranzahlkonflikt.
List_of_images_not_found
ist eine List(Of String).Ich habe bereits in Einzelschritten debuggt. Der Fehler ist tatsächlich in der Zeile mit Me.Invoke().
Hat sich erledigt :
VB.NET-Quellcode
- If List_of_images_not_found.Count > 0 Then
- If Application.OpenForms.OfType(Of Form_of_not_found_images)().Count() = 1 Then
- Application.OpenForms.OfType(Of Form_of_not_found_images)().First().Close()
- End If
- Dim Fonfi As New Form_of_not_found_images
- Dim thisaction As Action = Sub()
- Fonfi.ShowData(List_of_images_not_found)
- Fonfi.Show()
- End Sub
- Me.Invoke(thisaction)
- End If
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Bartosz“ ()