0

我做得很好,然后当我试图更改我的控件的名称时,标签页上的所有控件都消失了。设计文件中的代码仍然存在,我可以在属性窗口中看到所有控件,但如果我选择一个,则没有任何反应。如果我尝试在它出现的表单上放置一个新控件。有趣的是,当我尝试在窗体上放置一个新控件时,我看到所有试图将新控件与现有控件对齐的蓝色和粉色线条

这是设计器代码

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmTaxInvoiceRegister
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)
    If disposing AndAlso components IsNot Nothing Then
        components.Dispose()
    End If
    MyBase.Dispose(disposing)
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()
    Me.components = New System.ComponentModel.Container()
    Me.epValidator = New System.Windows.Forms.ErrorProvider(Me.components)
    Me.tclTaxInvoiceRegister = New Common.CustomControls.TabControlDAI()
    Me.tpgTaxInvoiceRegister = New Common.CustomControls.TabPageDAI()
    Me.lblEndDate = New System.Windows.Forms.Label()
    Me.lblStartDate = New System.Windows.Forms.Label()
    Me.dtpEndDate = New System.Windows.Forms.DateTimePicker()
    Me.dtpStartDate = New System.Windows.Forms.DateTimePicker()
    Me.btnRunReport = New System.Windows.Forms.Button()
    Me.grpTaxAddress = New System.Windows.Forms.GroupBox()
    Me.lblTaxAddress2 = New System.Windows.Forms.Label()
    Me.lblTaxAddress3 = New System.Windows.Forms.Label()
    Me.ReadOnlyTextBox5 = New Common.CustomControls.ReadOnlyTextBox()
    Me.lblTaxAddress1 = New System.Windows.Forms.Label()
    Me.ReadOnlyTextBox3 = New Common.CustomControls.ReadOnlyTextBox()
    Me.ReadOnlyTextBox4 = New Common.CustomControls.ReadOnlyTextBox()
    Me.lblTaxId = New System.Windows.Forms.Label()
    Me.lblOwnerName = New System.Windows.Forms.Label()
    Me.lblReportType = New System.Windows.Forms.Label()
    Me.ReadOnlyTextBox2 = New Common.CustomControls.ReadOnlyTextBox()
    Me.ReadOnlyTextBox1 = New Common.CustomControls.ReadOnlyTextBox()
    Me.cboReportType = New Common.CustomControls.ReadOnlyComboBox()
    CType(Me.epValidator, System.ComponentModel.ISupportInitialize).BeginInit()
    Me.tclTaxInvoiceRegister.SuspendLayout()
    Me.grpTaxAddress.SuspendLayout()
    Me.SuspendLayout()
    '
    'epValidator
    '
    Me.epValidator.ContainerControl = Me
    '
    'tclTaxInvoiceRegister
    '
    Me.tclTaxInvoiceRegister.AllowPageInsert = False
    Me.tclTaxInvoiceRegister.AllowPageReplace = False
    Me.tclTaxInvoiceRegister.Controls.Add(Me.tpgTaxInvoiceRegister)
    Me.tclTaxInvoiceRegister.Location = New System.Drawing.Point(2, 2)
    Me.tclTaxInvoiceRegister.Name = "tclTaxInvoiceRegister"
    Me.tclTaxInvoiceRegister.SelectedIndex = 0
    Me.tclTaxInvoiceRegister.Size = New System.Drawing.Size(398, 360)
    Me.tclTaxInvoiceRegister.TabIndex = 0
    Me.tclTaxInvoiceRegister.ValidationResult = System.Windows.Forms.DialogResult.None
    '
    'tpgTaxInvoiceRegister
    '
    Me.tpgTaxInvoiceRegister.BackColor = System.Drawing.SystemColors.Control
    Me.tpgTaxInvoiceRegister.IgnoreValidation = False
    Me.tpgTaxInvoiceRegister.Location = New System.Drawing.Point(4, 22)
    Me.tpgTaxInvoiceRegister.Name = "tpgTaxInvoiceRegister"
    Me.tpgTaxInvoiceRegister.Padding = New System.Windows.Forms.Padding(3)
    Me.tpgTaxInvoiceRegister.Size = New System.Drawing.Size(390, 334)
    Me.tpgTaxInvoiceRegister.TabIndex = 1017
    Me.tpgTaxInvoiceRegister.Text = "Tax Invoice Creation"
    '
    'lblEndDate
    '
    Me.lblEndDate.AutoSize = True
    Me.lblEndDate.Location = New System.Drawing.Point(235, 101)
    Me.lblEndDate.Name = "lblEndDate"
    Me.lblEndDate.Size = New System.Drawing.Size(55, 13)
    Me.lblEndDate.TabIndex = 17
    Me.lblEndDate.Text = "End Date:"
    '
    'lblStartDate
    '
    Me.lblStartDate.AutoSize = True
    Me.lblStartDate.Location = New System.Drawing.Point(13, 101)
    Me.lblStartDate.Name = "lblStartDate"
    Me.lblStartDate.Size = New System.Drawing.Size(58, 13)
    Me.lblStartDate.TabIndex = 16
    Me.lblStartDate.Text = "Start Date:"
    '
    'dtpEndDate
    '
    Me.dtpEndDate.CustomFormat = "MMM-yyyy"
    Me.dtpEndDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom
    Me.dtpEndDate.Location = New System.Drawing.Point(296, 97)
    Me.dtpEndDate.Name = "dtpEndDate"
    Me.dtpEndDate.Size = New System.Drawing.Size(73, 20)
    Me.dtpEndDate.TabIndex = 15
    Me.dtpEndDate.Value = New Date(2012, 10, 17, 0, 0, 0, 0)
    '
    'dtpStartDate
    '
    Me.dtpStartDate.CustomFormat = "MMM-yyyy"
    Me.dtpStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom
    Me.dtpStartDate.Location = New System.Drawing.Point(77, 97)
    Me.dtpStartDate.Name = "dtpStartDate"
    Me.dtpStartDate.Size = New System.Drawing.Size(73, 20)
    Me.dtpStartDate.TabIndex = 14
    Me.dtpStartDate.Value = New Date(2012, 10, 17, 0, 0, 0, 0)
    '
    'btnRunReport
    '
    Me.btnRunReport.Location = New System.Drawing.Point(147, 294)
    Me.btnRunReport.Name = "btnRunReport"
    Me.btnRunReport.Size = New System.Drawing.Size(97, 23)
    Me.btnRunReport.TabIndex = 13
    Me.btnRunReport.Text = "Create Tax File"
    Me.btnRunReport.UseVisualStyleBackColor = True
    '
    'grpTaxAddress
    '
    Me.grpTaxAddress.Controls.Add(Me.lblTaxAddress2)
    Me.grpTaxAddress.Controls.Add(Me.lblTaxAddress3)
    Me.grpTaxAddress.Controls.Add(Me.ReadOnlyTextBox5)
    Me.grpTaxAddress.Controls.Add(Me.lblTaxAddress1)
    Me.grpTaxAddress.Controls.Add(Me.ReadOnlyTextBox3)
    Me.grpTaxAddress.Controls.Add(Me.ReadOnlyTextBox4)
    Me.grpTaxAddress.Location = New System.Drawing.Point(6, 179)
    Me.grpTaxAddress.Name = "grpTaxAddress"
    Me.grpTaxAddress.Size = New System.Drawing.Size(379, 109)
    Me.grpTaxAddress.TabIndex = 11
    Me.grpTaxAddress.TabStop = False
    Me.grpTaxAddress.Text = "Tax Address"
    '
    'lblTaxAddress2
    '
    Me.lblTaxAddress2.AutoSize = True
    Me.lblTaxAddress2.Location = New System.Drawing.Point(6, 55)
    Me.lblTaxAddress2.Name = "lblTaxAddress2"
    Me.lblTaxAddress2.Size = New System.Drawing.Size(39, 13)
    Me.lblTaxAddress2.TabIndex = 12
    Me.lblTaxAddress2.Text = "Line 2:"
    '
    'lblTaxAddress3
    '
    Me.lblTaxAddress3.AutoSize = True
    Me.lblTaxAddress3.Location = New System.Drawing.Point(6, 82)
    Me.lblTaxAddress3.Name = "lblTaxAddress3"
    Me.lblTaxAddress3.Size = New System.Drawing.Size(39, 13)
    Me.lblTaxAddress3.TabIndex = 11
    Me.lblTaxAddress3.Text = "Line 3:"
    '
    'ReadOnlyTextBox5
    '
    Me.ReadOnlyTextBox5.Location = New System.Drawing.Point(51, 79)
    Me.ReadOnlyTextBox5.Name = "ReadOnlyTextBox5"
    Me.ReadOnlyTextBox5.Size = New System.Drawing.Size(312, 20)
    Me.ReadOnlyTextBox5.TabIndex = 5
    '
    'lblTaxAddress1
    '
    Me.lblTaxAddress1.AutoSize = True
    Me.lblTaxAddress1.Location = New System.Drawing.Point(6, 28)
    Me.lblTaxAddress1.Name = "lblTaxAddress1"
    Me.lblTaxAddress1.Size = New System.Drawing.Size(39, 13)
    Me.lblTaxAddress1.TabIndex = 10
    Me.lblTaxAddress1.Text = "Line 1:"
    '
    'ReadOnlyTextBox3
    '
    Me.ReadOnlyTextBox3.Location = New System.Drawing.Point(51, 25)
    Me.ReadOnlyTextBox3.Name = "ReadOnlyTextBox3"
    Me.ReadOnlyTextBox3.Size = New System.Drawing.Size(312, 20)
    Me.ReadOnlyTextBox3.TabIndex = 3
    '
    'ReadOnlyTextBox4
    '
    Me.ReadOnlyTextBox4.Location = New System.Drawing.Point(51, 52)
    Me.ReadOnlyTextBox4.Name = "ReadOnlyTextBox4"
    Me.ReadOnlyTextBox4.Size = New System.Drawing.Size(312, 20)
    Me.ReadOnlyTextBox4.TabIndex = 4
    '
    'lblTaxId
    '
    Me.lblTaxId.AutoSize = True
    Me.lblTaxId.Location = New System.Drawing.Point(3, 156)
    Me.lblTaxId.Name = "lblTaxId"
    Me.lblTaxId.Size = New System.Drawing.Size(40, 13)
    Me.lblTaxId.TabIndex = 8
    Me.lblTaxId.Text = "Tax Id:"
    '
    'lblOwnerName
    '
    Me.lblOwnerName.AutoSize = True
    Me.lblOwnerName.Location = New System.Drawing.Point(3, 130)
    Me.lblOwnerName.Name = "lblOwnerName"
    Me.lblOwnerName.Size = New System.Drawing.Size(127, 13)
    Me.lblOwnerName.TabIndex = 7
    Me.lblOwnerName.Text = "Company / Owner Name:"
    '
    'lblReportType
    '
    Me.lblReportType.AutoSize = True
    Me.lblReportType.Location = New System.Drawing.Point(3, 32)
    Me.lblReportType.Name = "lblReportType"
    Me.lblReportType.Size = New System.Drawing.Size(66, 13)
    Me.lblReportType.TabIndex = 6
    Me.lblReportType.Text = "Report Type"
    '
    'ReadOnlyTextBox2
    '
    Me.ReadOnlyTextBox2.Location = New System.Drawing.Point(133, 153)
    Me.ReadOnlyTextBox2.Name = "ReadOnlyTextBox2"
    Me.ReadOnlyTextBox2.Size = New System.Drawing.Size(100, 20)
    Me.ReadOnlyTextBox2.TabIndex = 2
    '
    'ReadOnlyTextBox1
    '
    Me.ReadOnlyTextBox1.Location = New System.Drawing.Point(133, 127)
    Me.ReadOnlyTextBox1.Name = "ReadOnlyTextBox1"
    Me.ReadOnlyTextBox1.Size = New System.Drawing.Size(236, 20)
    Me.ReadOnlyTextBox1.TabIndex = 1
    '
    'cboReportType
    '
    Me.cboReportType.FormattingEnabled = True
    Me.cboReportType.Location = New System.Drawing.Point(75, 29)
    Me.cboReportType.Name = "cboReportType"
    Me.cboReportType.Size = New System.Drawing.Size(294, 21)
    Me.cboReportType.TabIndex = 18
    '
    'frmTaxInvoiceRegister
    '
    Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
    Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
    Me.ClientSize = New System.Drawing.Size(404, 371)
    Me.Controls.Add(Me.tclTaxInvoiceRegister)
    Me.Name = "frmTaxInvoiceRegister"
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
    Me.Text = "Tax Invoice Register"
    CType(Me.epValidator, System.ComponentModel.ISupportInitialize).EndInit()
    Me.tclTaxInvoiceRegister.ResumeLayout(False)
    Me.grpTaxAddress.ResumeLayout(False)
    Me.grpTaxAddress.PerformLayout()
    Me.ResumeLayout(False)

End Sub
Friend WithEvents epValidator As System.Windows.Forms.ErrorProvider
Friend WithEvents tclTaxInvoiceRegister As Common.CustomControls.TabControlDAI
Friend WithEvents tpgTaxInvoiceRegister As Common.CustomControls.TabPageDAI
Friend WithEvents lblTaxId As System.Windows.Forms.Label
Friend WithEvents lblOwnerName As System.Windows.Forms.Label
Friend WithEvents lblReportType As System.Windows.Forms.Label
Friend WithEvents ReadOnlyTextBox5 As Common.CustomControls.ReadOnlyTextBox
Friend WithEvents ReadOnlyTextBox4 As Common.CustomControls.ReadOnlyTextBox
Friend WithEvents ReadOnlyTextBox3 As Common.CustomControls.ReadOnlyTextBox
Friend WithEvents ReadOnlyTextBox2 As Common.CustomControls.ReadOnlyTextBox
Friend WithEvents ReadOnlyTextBox1 As Common.CustomControls.ReadOnlyTextBox
Friend WithEvents grpTaxAddress As System.Windows.Forms.GroupBox
Friend WithEvents lblTaxAddress2 As System.Windows.Forms.Label
Friend WithEvents lblTaxAddress3 As System.Windows.Forms.Label
Friend WithEvents lblTaxAddress1 As System.Windows.Forms.Label
Friend WithEvents ctlRestaurantSelector As Common.BusinessControls.Subway.RestaurantSelector
Friend WithEvents btnRunReport As System.Windows.Forms.Button
Friend WithEvents dtpStartDate As System.Windows.Forms.DateTimePicker
Friend WithEvents lblEndDate As System.Windows.Forms.Label
Friend WithEvents lblStartDate As System.Windows.Forms.Label
Friend WithEvents dtpEndDate As System.Windows.Forms.DateTimePicker
Friend WithEvents cboReportType As Common.CustomControls.ReadOnlyComboBox
End Class

这是我看到的

跆拳道

4

2 回答 2

0

VS 表单设计者正在尝试做一些相当困难的事情(安全地执行部分编写的程序的一部分),但他们并不总是能成功。(我在这里对VS保持礼貌......)

当这样的事情出错时,最好的办法是关闭所有设计器窗口和任何其他打开相同表单类的源代码的窗口,然后重新构建完整的应用程序,然后再次尝试进入设计器。如果这不起作用,则可能需要重新启动 VS。

如果您创建了在表单生命周期的早期抛出异常的情况(例如,来自构造函数),那么 VS 真的很难解决这个问题。

VS 的每个版本都试图对此进行改进,但是虽然我看到失败的外观发生了变化,但我从来没有看到太多的净改进......

于 2012-10-18T12:45:24.077 回答
0

缺少将控件实际添加到标签页容器的代码

    Me.tpgTaxInvoiceRegister.Controls.Add(Me.ctlRestaurantSelector)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.lblTaxId)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.lblOwnerName)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.lblReportType)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.ReadOnlyTextBox2)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.ReadOnlyTextBox1)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.grpTaxAddress)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.btnRunReport)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.dtpStartDate)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.lblEndDate)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.lblStartDate)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.dtpEndDate)
    Me.tpgTaxInvoiceRegister.Controls.Add(Me.cboReportType)

修复。

于 2012-10-18T13:32:40.963 回答