Form2.Show() ----> Error

  • VB.NET

Es gibt 6 Antworten in diesem Thema. Der letzte Beitrag () ist von RodFromGermany.

    Form2.Show() ----> Error

    Hey,
    Mal wieder ein Problem und zwar hab ich gemacht wenn man auf ein Button klickt öffnet sich die Form2 mit Form2.Show() und die form1 wird mit Form1.Enabled = false deaktiviert.
    Nachdem ich das Programm gestartet hab und auf den Button klick kommt ein Error und zwar:

    InvalidOperationException wurde nicht behandelt!

    hier noch ganz ganz viele Infos zur meldung

    Meldungs Info
    System.InvalidOperationException wurde nicht behandelt.
    HResult=-2146233079
    Message=Fehler beim Erstellen des Formulars. Weitere Informationen finden Sie in Exception.InnerException. Fehler: Ungültige Konvertierung von der Zeichenfolge GrandThefLuke\GTL in Typ Double..
    Source=GrandThefLuke Launcher
    StackTrace:
    bei GrandThefLuke_Launcher.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 190.
    bei GrandThefLuke_Launcher.My.MyProject.MyForms.get_Form2()
    bei GrandThefLuke_Launcher.Form1.Button2_Click(Object sender, EventArgs e) in C:\Users\David\Documents\Visual Studio 2010\Projects\GrandThefLuke_Starter\GrandThefLuke_Starter\Form1.vb:Zeile 39.
    bei System.Windows.Forms.Control.OnClick(EventArgs e)
    bei System.Windows.Forms.Button.OnClick(EventArgs e)
    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.Control.ControlNativeWindow.OnMessage(Message& m)
    bei System.Windows.Forms.Control.ControlNativeWindow.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 System.Windows.Forms.Application.Run(ApplicationContext context)
    bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    bei GrandThefLuke_Launcher.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
    bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    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: System.InvalidCastException
    HResult=-2147467262
    Message=Ungültige Konvertierung von der Zeichenfolge GrandThefLuke\GTL in Typ Double.
    Source=Microsoft.VisualBasic
    StackTrace:
    bei Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)
    bei Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value)
    bei GrandThefLuke_Launcher.Form2..ctor() in C:\Users\David\Documents\Visual Studio 2010\Projects\GrandThefLuke_Starter\GrandThefLuke_Starter\Form2.vb:Zeile 10.
    InnerException: System.FormatException
    HResult=-2146233033
    Message=Die Eingabezeichenfolge hat das falsche Format.
    Source=Microsoft.VisualBasic
    StackTrace:
    bei Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
    bei Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)
    InnerException:

    PSYCHO3399 schrieb:

    Danke hat geklappt
    Offensichtlich nicht, denn den eigentlichen Fehler hast Du noch nicht beseitigt.
    Setz einen Haltepunkt in die Prozedur und kläre explizit auf, warum es knallt.
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!