我目前正在为一个小项目创建一小块软件。但是当我试图打开另一个表单时,我得到一个错误。我已附上下面的所有错误和表单代码。我只是刚开始这个项目而且我收到了以前从未收到的这些错误。我可能会因为错过一些非常简单的东西而自责。
错误
System.InvalidOperationException was unhandled
HResult=-2146233079
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "WindowsApplication2.AddBookingForm.resources" was correctly embedded or linked into assembly "WindowsApplication2" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Source=WindowsApplication2
StackTrace:
at WindowsApplication2.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at WindowsApplication2.My.MyProject.MyForms.get_AddBookingForm()
at WindowsApplication2.MainForm.AddButton_Click(Object sender, EventArgs e) in C:\Users\Andrew\Documents\Visual Studio 2013\Projects\WindowsApplication2\WindowsApplication2\MainForm.vb:line 4
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WindowsApplication2.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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Resources.MissingManifestResourceException
HResult=-2146233038
Message=Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "WindowsApplication2.AddBookingForm.resources" was correctly embedded or linked into assembly "WindowsApplication2" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Source=mscorlib
StackTrace:
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
at System.Resources.ResourceManager.GetObject(String name)
at WindowsApplication2.AddBookingForm.InitializeComponent() in C:\Users\Andrew\Documents\Visual Studio 2013\Projects\WindowsApplication2\WindowsApplication2\AddNewBooking.Designer.vb:line 234
at WindowsApplication2.AddBookingForm..ctor()
InnerException:
的MainForm
Public Class MainForm
Private Sub AddButton_Click(sender As Object, e As EventArgs) Handles AddButton.Click
AddBookingForm.Show()
End Sub
End Class
AddBookingForm
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class AddBookingForm
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AddBookingForm))
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.Label7 = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.SearchButton = New System.Windows.Forms.Button()
Me.AddJobNoText = New System.Windows.Forms.TextBox()
Me.AddNameText = New System.Windows.Forms.TextBox()
Me.AddPhoneList = New System.Windows.Forms.ListBox()
Me.AddAddressText = New System.Windows.Forms.TextBox()
Me.AddTypeCombo = New System.Windows.Forms.ComboBox()
Me.AddTimeCombo = New System.Windows.Forms.ComboBox()
Me.AddDatePicker = New System.Windows.Forms.DateTimePicker()
Me.AddOtherText = New System.Windows.Forms.TextBox()
Me.AddAddButton = New System.Windows.Forms.Button()
Me.AddExitButton = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(24, 15)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(67, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Job Number:"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(53, 51)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(38, 13)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Name:"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(5, 87)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(86, 13)
Me.Label3.TabIndex = 2
Me.Label3.Text = "Phone Numbers:"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(43, 197)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(48, 13)
Me.Label4.TabIndex = 3
Me.Label4.Text = "Address:"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(37, 285)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(54, 13)
Me.Label5.TabIndex = 4
Me.Label5.Text = "Job Type:"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(58, 321)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(33, 13)
Me.Label6.TabIndex = 5
Me.Label6.Text = "Time:"
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Location = New System.Drawing.Point(58, 357)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(33, 13)
Me.Label7.TabIndex = 6
Me.Label7.Text = "Date:"
'
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.Location = New System.Drawing.Point(0, 392)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(91, 13)
Me.Label8.TabIndex = 7
Me.Label8.Text = "Other Information:"
'
'SearchButton
'
Me.SearchButton.Location = New System.Drawing.Point(215, 12)
Me.SearchButton.Name = "SearchButton"
Me.SearchButton.Size = New System.Drawing.Size(59, 20)
Me.SearchButton.TabIndex = 8
Me.SearchButton.Text = "Search"
Me.SearchButton.UseVisualStyleBackColor = True
'
'AddJobNoText
'
Me.AddJobNoText.Location = New System.Drawing.Point(93, 12)
Me.AddJobNoText.Name = "AddJobNoText"
Me.AddJobNoText.Size = New System.Drawing.Size(116, 20)
Me.AddJobNoText.TabIndex = 9
'
'AddNameText
'
Me.AddNameText.Location = New System.Drawing.Point(93, 48)
Me.AddNameText.Name = "AddNameText"
Me.AddNameText.Size = New System.Drawing.Size(181, 20)
Me.AddNameText.TabIndex = 10
'
'AddPhoneList
'
Me.AddPhoneList.FormattingEnabled = True
Me.AddPhoneList.Location = New System.Drawing.Point(93, 84)
Me.AddPhoneList.Name = "AddPhoneList"
Me.AddPhoneList.Size = New System.Drawing.Size(181, 95)
Me.AddPhoneList.TabIndex = 11
'
'AddAddressText
'
Me.AddAddressText.Location = New System.Drawing.Point(93, 194)
Me.AddAddressText.Multiline = True
Me.AddAddressText.Name = "AddAddressText"
Me.AddAddressText.Size = New System.Drawing.Size(181, 73)
Me.AddAddressText.TabIndex = 12
'
'AddTypeCombo
'
Me.AddTypeCombo.FormattingEnabled = True
Me.AddTypeCombo.Items.AddRange(New Object() {"Pickup", "Delivery", "Tune-In", "Set-Up", "Antenna", "Other"})
Me.AddTypeCombo.Location = New System.Drawing.Point(93, 282)
Me.AddTypeCombo.Name = "AddTypeCombo"
Me.AddTypeCombo.Size = New System.Drawing.Size(181, 21)
Me.AddTypeCombo.TabIndex = 13
'
'AddTimeCombo
'
Me.AddTimeCombo.FormattingEnabled = True
Me.AddTimeCombo.Items.AddRange(New Object() {"AM", "PM"})
Me.AddTimeCombo.Location = New System.Drawing.Point(93, 318)
Me.AddTimeCombo.Name = "AddTimeCombo"
Me.AddTimeCombo.Size = New System.Drawing.Size(181, 21)
Me.AddTimeCombo.TabIndex = 14
'
'AddDatePicker
'
Me.AddDatePicker.Location = New System.Drawing.Point(93, 354)
Me.AddDatePicker.Name = "AddDatePicker"
Me.AddDatePicker.Size = New System.Drawing.Size(181, 20)
Me.AddDatePicker.TabIndex = 15
'
'AddOtherText
'
Me.AddOtherText.Location = New System.Drawing.Point(93, 389)
Me.AddOtherText.Multiline = True
Me.AddOtherText.Name = "AddOtherText"
Me.AddOtherText.Size = New System.Drawing.Size(181, 61)
Me.AddOtherText.TabIndex = 16
'
'AddAddButton
'
Me.AddAddButton.Location = New System.Drawing.Point(42, 459)
Me.AddAddButton.Name = "AddAddButton"
Me.AddAddButton.Size = New System.Drawing.Size(89, 23)
Me.AddAddButton.TabIndex = 17
Me.AddAddButton.Text = "Add Booking"
Me.AddAddButton.UseVisualStyleBackColor = True
'
'AddExitButton
'
Me.AddExitButton.Location = New System.Drawing.Point(152, 459)
Me.AddExitButton.Name = "AddExitButton"
Me.AddExitButton.Size = New System.Drawing.Size(89, 23)
Me.AddExitButton.TabIndex = 18
Me.AddExitButton.Text = "Exit"
Me.AddExitButton.UseVisualStyleBackColor = True
'
'AddBookingForm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(283, 491)
Me.Controls.Add(Me.AddExitButton)
Me.Controls.Add(Me.AddAddButton)
Me.Controls.Add(Me.AddOtherText)
Me.Controls.Add(Me.AddDatePicker)
Me.Controls.Add(Me.AddTimeCombo)
Me.Controls.Add(Me.AddTypeCombo)
Me.Controls.Add(Me.AddAddressText)
Me.Controls.Add(Me.AddPhoneList)
Me.Controls.Add(Me.AddNameText)
Me.Controls.Add(Me.AddJobNoText)
Me.Controls.Add(Me.SearchButton)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "AddBookingForm"
Me.Text = "Add New Booking"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents SearchButton As System.Windows.Forms.Button
Friend WithEvents AddJobNoText As System.Windows.Forms.TextBox
Friend WithEvents AddNameText As System.Windows.Forms.TextBox
Friend WithEvents AddPhoneList As System.Windows.Forms.ListBox
Friend WithEvents AddAddressText As System.Windows.Forms.TextBox
Friend WithEvents AddTypeCombo As System.Windows.Forms.ComboBox
Friend WithEvents AddTimeCombo As System.Windows.Forms.ComboBox
Friend WithEvents AddDatePicker As System.Windows.Forms.DateTimePicker
Friend WithEvents AddOtherText As System.Windows.Forms.TextBox
Friend WithEvents AddAddButton As System.Windows.Forms.Button
Friend WithEvents AddExitButton As System.Windows.Forms.Button
Private Sub AddExitButton_Click(sender As Object, e As EventArgs) Handles AddExitButton.Click
'AddJobNoText.Clear()
'AddNameText.Clear()
'AddOtherText.Clear()
'AddAddressText.Clear()
'AddPhoneList.Text = ""
'AddTypeCombo.Text = ""
'AddTimeCombo.Text = ""
'Me.Close()
End Sub
End Class
答案 0 :(得分:0)
尝试以下和评论
Private Sub AddButton_Click(sender As Object, e As EventArgs) Handles AddButton.Click
with AddBookingForm
.Mdiparent = Me 'here me is the MDIParent form in your case `MainForm`
.Show()
.Focus()
End With
End Sub