我有一个简单的winform应用程序,我GroupBox
在designer.cs页面中有一个我也可以在设计中看到的页面。现在,当我尝试访问m_ConstraintGroupBox
后面的代码时ComboBox
Label
,我无法访问我可以访问的位置和其他控件。下面在我的设计器代码中。
System.Windows.Forms.GroupBox m_ConstraintGroupBox;
m_ConstraintGroupBox= new System.Windows.Forms.GroupBox();
m_ConstraintGroupBox.SuspendLayout();
m_ConstraintGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
m_ConstraintGroupBox.Controls.Add(this.cmbConstriant);
m_ConstraintGroupBox.Controls.Add(this.lblConstraint);
m_ConstraintGroupBox.Controls.Add(this.groupBox1);
m_ConstraintGroupBox.Location = new System.Drawing.Point(378, 194);
m_ConstraintGroupBox.Name = "m_ConstraintGroupBox";
m_ConstraintGroupBox.Size = new System.Drawing.Size(216, 79);
m_ConstraintGroupBox.TabIndex = 3;
m_ConstraintGroupBox.TabStop = false;
m_ConstraintGroupBox.Text = "Constraint";
访问代码如下
public sealed partial class LinkForm : AMBaseForm
{
private Link m_link;
private readonly BindingList<Interface> m_interfaces = new BindingList<Interface>();
private DomainFilterROCollection<ComponentClass> m_availComponentClasses;
private DomainFilterROCollection<Gauge> m_gaugies;
public LinkForm()
{
InitializeComponent();
cmbConstriant.Visible = false;
lblConstraint.Visible = false;
m_ConstraintGroupBox.
m_ChooseIconControlControl.IsNode = false;
}
}