【发布时间】:2026-02-17 00:15:01
【问题描述】:
请帮忙!我的VB项目中无法查看控制参数调整表,其他三种正常。
我该如何解决这个问题?
这里是 Designer.vb 代码:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Control_Parameter_Adjustment
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()
Me.Label1 = New System.Windows.Forms.Label()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.Label31 = New System.Windows.Forms.Label()
......
End Class
【问题讨论】:
-
为什么不能“查看控制参数调整表”?有什么错误吗?
-
另外,请记住,设计器在设置 UI 时会执行调用的代码,因此您的表单设置中不应调用的任何内容都应使用
If Not DesignMode Then .... End If -
您的
.Designer文件有问题...发布Control Parameter Adjustment.Designer.vb...的代码。截至目前,它将其视为一个类而不是一个表格. -
@Xi Wang 你的班级好像有空格,不能有空格。你修改了这些?例如:
Control Parameter Adjustment***应该是Control_Parameter_Adjustment...您的设计器文件的名称中确实包含_,但您在树中的类没有显示这些...您还缺少Me.SuspendLayout()在InitializeComponent子和Me.ResumeLayout(False)... -
问题不一定是
*.Designer.vb文件,也可能是项目文件。尝试从项目中删除表单及其文件(但不是从磁盘中!),然后将它们重新导入项目。