James
2011-07-27 13:42:51 UTC
Heres the Error:
System.InvalidOperationException was unhandled
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.
Source=CombatCalc
StackTrace:
at CombatCalc.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at CombatCalc.My.MyProject.MyForms.get_Form1()
at CombatCalc.My.MyApplication.OnCreateMainForm() in C:\Users\James\AppData\Local\Temporary Projects\CombatCalc\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at CombatCalc.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.NullReferenceException
Message=Object reference not set to an instance of an object.
Source=CombatCalc
StackTrace:
at CombatCalc.Form1..ctor() in C:\Users\James\AppData\Local\Temporary Projects\CombatCalc\Form1.vb:line 5
InnerException:
Here's the code:
Public Class Form1
Dim Quarter As Decimal = ".25"
Dim Half As Decimal = ".5"
Dim ThirteenDIVTen As Decimal = "1.3"
Dim HalfPrayer As Decimal = TextBox5.Text * Half
Dim HalfSummoning As Decimal = TextBox6.Text * Half
Dim Attack As Decimal = TextBox1.Text
Dim Strength As Decimal = TextBox2.Text
Dim Defense As Decimal = TextBox3.Text
Dim Constitution As Decimal = TextBox4.Text
Dim AttackPLUSStrength As Decimal = Attack + Strength
Dim AttackStrengthTIMESThirteenDIVTen = AttackPLUSStrength * ThirteenDIVTen
Dim NeedsQuarter As Decimal = AttackStrengthTIMESThirteenDIVTen + Defense + Constitution + HalfPrayer + HalfSummoning
Dim AddQuarter As Decimal = NeedsQuarter * Quarter
Private Sub BtnCalcMelee_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCalcMelee.Click
Label7.Text = AddQuarter
End Sub
End Class