Winforms 同一WinForm上不能有2个抽象派生文本框?

Winforms 同一WinForm上不能有2个抽象派生文本框?,winforms,textbox,abstract,handle,Winforms,Textbox,Abstract,Handle,好吧,这是个奇怪的问题。我有一个从TextBox派生的名为Writer的抽象控件,以及从中派生的两个类,StdWriter和LngWriter。它们之间的区别是一个始终是多行的,而另一个则不是。这是两者之间唯一的区别 在OnHandleCreated函数中,我使用Win32 SendMessage函数设置边距。我在OnPaint中再次这样做,因为如果同一表单上有超过1个StdWriter(或任何派生的文本框类型),WinForms将“忘记”设置边距(这也没有意义,但至少我有一个解决方法) 现在我

好吧,这是个奇怪的问题。我有一个从TextBox派生的名为Writer的抽象控件,以及从中派生的两个类,StdWriter和LngWriter。它们之间的区别是一个始终是多行的,而另一个则不是。这是两者之间唯一的区别

在OnHandleCreated函数中,我使用Win32 SendMessage函数设置边距。我在OnPaint中再次这样做,因为如果同一表单上有超过1个StdWriter(或任何派生的文本框类型),WinForms将“忘记”设置边距(这也没有意义,但至少我有一个解决方法)

现在我有一个问题,我不能让这两个文本框在同一个表单上。如果我在表单上放置一个StdWriter和一个多行文本框,或者一个LngWriter和一个标准文本框,它就会工作。如果我在表单上放置2个MS文本框,它也可以工作。但是,让我将LngWriter和StdWriter放在一起,LngWriter将不会正确绘制其滚动条(垂直方向是错误的,它只是不会绘制水平方向的句点)或接受ENTER键,尽管MultiLine和AcceptsReturn都返回true。我甚至不能粘贴新行,因为它完全删除了它们

我不明白这一点,因为TextBox是从抽象TextBoxBase派生的,我的表单上有几十个不同的派生文本框,我没有任何问题。是因为我在继承链中插入了第二个抽象类,而VisualStudio不喜欢它还是什么

    public abstract class RKWRITER : System.Windows.Forms.TextBox
    {
        protected sealed class RKLAYOUT : System.Windows.Forms.TableLayoutPanel
        protected sealed class RKFLIPPER : System.Windows.Forms.CheckBox
        protected sealed class RKBITMAP : System.Windows.Forms.PictureBox
        protected RKSHARP2.Controls.RKWRITER.RKLAYOUT Control_Secondary = null;
        protected RKSHARP2.Controls.RKWRITER.RKBITMAP Control_IconView = null;
        protected RKSHARP2.Controls.RKWRITER.RKFLIPPER Control_NullView = null;
        public override System.Boolean Multiline
        {
            get
            {
                return base.Multiline;
            }
            set
            {
                this.SuspendLayout();
                base.Multiline = value;
                this.RecreateHandle();
                this.ResumeLayout();
                this.PerformLayout();
                this.Invalidate();
            }
        }
        protected static void SetControlBuffer (System.IntPtr Pointer_Control, System.Int32 Integer_West, System.Int32 Integer_East)
        {
            RKSHARP2.System.Internal.USER32.SendMessage(Pointer_Control, RKSHARP2.System.Internal.USER32.EM_SETMARGINS, new System.IntPtr(RKSHARP2.System.Internal.USER32.EC_LEFTMARGIN|RKSHARP2.System.Internal.USER32.EC_RIGHTMARGIN), new System.IntPtr((0x00010000 * Integer_East) + Integer_West));
        }
    }

    public sealed class RKSTANDARDWRITER : RKSHARP2.Controls.RKWRITER
    {
        public override System.Boolean Multiline
        {
            get
            {
                return false;
            }
            set
            {
                this.SuspendLayout();
                base.Multiline = false;
                this.RecreateHandle();
                this.ResumeLayout();
                this.PerformLayout();
                this.Invalidate();
            }
        }

        public RKSTANDARDWRITER ()
        {
            this.SuspendLayout();
            this.AcceptsReturn = false;
            this.AcceptsTab = false;
            this.AutoSize = false;
            this.DoubleBuffered = true;
            this.Margin = new System.Windows.Forms.Padding(0);
            this.MaxLength = 24;
            this.Multiline = false;
            this.Padding = new System.Windows.Forms.Padding(0);
            this.PasswordChar = RKSHARP2.Constants.NULLZERO;
            this.ResizeRedraw = true;
            this.ScrollBars = System.Windows.Forms.ScrollBars.None;
            this.Text = null;
            this.UseSystemPasswordChar = false;
            this.Vertical = 1;
            this.Visible = true;
            this.WordWrap = false;
            this.SetControlProperties(null, false, new System.Drawing.Size(0, 0), null, false, true);
            this.ResumeLayout();
            this.PerformLayout();
        }

        #pragma warning disable 1591
        protected override void OnHandleCreated (System.EventArgs Object_Arguments)
        {
            base.OnHandleCreated(Object_Arguments);
            this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, System.Math.Max(this.FontHeight, this.Control_Secondary.PreferredSize.Height) * this.Vertical);
            RKSHARP2.Controls.RKSTANDARDWRITER.SetControlBuffer(this.Handle, this.Control_Secondary.PreferredSize.Width, 0);
        }
        protected override void OnPaint (System.Windows.Forms.PaintEventArgs Object_Arguments)
        {
            //RRK: I have no idea WTF is suddenly wrong here but Windows will not set margins in OnHandleCreated() if multiple controls are present.
            base.OnPaint(Object_Arguments);
            RKSHARP2.Controls.RKSTANDARDWRITER.SetControlBuffer(this.Handle, this.Control_Secondary.PreferredSize.Width, 0);
        }
        protected override void WndProc (ref System.Windows.Forms.Message Object_Message)
        {
            #pragma warning disable 0162
            switch (Object_Message.Msg)
            {
                default:
                {
                    base.WndProc(ref Object_Message);
                }
                break;
            }
            #pragma warning restore 0162
        }
        public override System.Drawing.Size MinimumSize
        {
            get
            {
                return RKSHARP2.Windows.WindowSystemController.CompareMaximumSizes(base.MinimumSize, this.SizeFromClientSize(new System.Drawing.Size(this.Control_Secondary.PreferredSize.Width, System.Math.Max(this.FontHeight, this.Control_Secondary.PreferredSize.Height))));
            }
            set
            {
                base.MinimumSize = value;
            }
        }
        public override System.Drawing.Size MaximumSize
        {
            get
            {
                return base.MaximumSize;
            }
            set
            {
                base.MaximumSize = value;
            }
        }
        public override System.Drawing.Size GetPreferredSize (System.Drawing.Size Struct_Proposed)
        {
            return base.GetPreferredSize(Struct_Proposed);
        }
        protected void SetControlProperties (System.String String_Startup, System.Boolean Boolean_IconView, System.Drawing.Size Struct_IconSize, System.Drawing.Bitmap Object_Bitmap, System.Boolean Boolean_NullView, System.Boolean Boolean_NullType)
        {
            this.Control_Secondary = new RKSHARP2.Controls.RKSTANDARDWRITER.RKLAYOUT();
            this.Control_Secondary.AutoSize = true;
            this.Control_Secondary.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.Control_Secondary.BackColor = System.Drawing.Color.Transparent;
            this.Control_Secondary.BackgroundImage = null;
            this.Control_Secondary.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.Control_Secondary.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.None;
            this.Control_Secondary.ColumnCount = 4;
            this.Control_Secondary.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100));
            this.Control_Secondary.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            this.Control_Secondary.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            this.Control_Secondary.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100));
            this.Control_Secondary.Dock = System.Windows.Forms.DockStyle.Left;
            this.Control_Secondary.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
            this.Control_Secondary.Margin = new System.Windows.Forms.Padding(0);
            this.Control_Secondary.Padding = new System.Windows.Forms.Padding(0);
            this.Control_Secondary.RowCount = 3;
            this.Control_Secondary.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100));
            this.Control_Secondary.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            this.Control_Secondary.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100));
            this.Control_Secondary.Size = new System.Drawing.Size(0, 0);
            this.Control_Secondary.TabIndex = 0;
            this.Control_Secondary.TabStop = false;
            this.Control_Secondary.Visible = true;
            this.Control_IconView = new RKSHARP2.Controls.RKSTANDARDWRITER.RKBITMAP();
            this.Control_IconView.AutoSize = false;
            this.Control_IconView.BackColor = System.Drawing.Color.Transparent;
            this.Control_IconView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.Control_IconView.Cursor = System.Windows.Forms.Cursors.Default;
            this.Control_IconView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.Control_IconView.Image = Object_Bitmap;
            this.Control_IconView.Margin = new System.Windows.Forms.Padding(0);
            this.Control_IconView.Padding = new System.Windows.Forms.Padding(0);
            this.Control_IconView.Parent = this;
            this.Control_IconView.Size = Struct_IconSize;
            this.Control_IconView.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.Control_IconView.TabIndex = 0;
            this.Control_IconView.TabStop = false;
            this.Control_IconView.Visible = Boolean_IconView;
            this.Control_IconView.VisibleChanged += new System.EventHandler(delegate(System.Object Object_Sender, System.EventArgs Object_Arguments){this.Control_IconView.Parent.Visible=this.IconView||this.NullView;});
            this.Control_NullView = new RKSHARP2.Controls.RKSTANDARDWRITER.RKFLIPPER();
            this.Control_NullView.AutoSize = true;
            this.Control_NullView.BackColor = System.Drawing.Color.Transparent;
            this.Control_NullView.Checked = true;
            this.Control_NullView.Cursor = System.Windows.Forms.Cursors.Default;
            this.Control_NullView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.Control_NullView.Enabled = !this.ReadOnly;
            this.Control_NullView.Margin = new System.Windows.Forms.Padding(0);
            this.Control_NullView.Padding = new System.Windows.Forms.Padding(0);
            this.Control_NullView.Parent = this;
            this.Control_NullView.Size = new System.Drawing.Size(0, 0);
            this.Control_NullView.TabIndex = 0;
            this.Control_NullView.TabStop = false;
            this.Control_NullView.Text = "";
            this.Control_NullView.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.Control_NullView.UseVisualStyleBackColor = true;
            this.Control_NullView.Visible = Boolean_NullView;
            this.Control_NullView.CheckedChanged += new System.EventHandler(delegate(System.Object Object_Sender, System.EventArgs Object_Arguments){this.ReadOnly=!this.Control_NullView.Checked;});
            this.Control_NullView.VisibleChanged += new System.EventHandler(delegate(System.Object Object_Sender, System.EventArgs Object_Arguments){this.Control_NullView.Parent.Visible=this.NullView||this.IconView;});
            this.Control_Secondary.SuspendLayout();
            this.Control_Secondary.Controls.Add(RKSHARP2.Controls.RKSTANDARDWRITER.ConstructContainer(this.Control_IconView), 1, 1);
            this.Control_Secondary.Controls.Add(RKSHARP2.Controls.RKSTANDARDWRITER.ConstructContainer(this.Control_NullView), 2, 1);
            this.Control_Secondary.ResumeLayout();
            this.Control_Secondary.PerformLayout();
            this.Controls.Add(this.Control_Secondary);
        } 
        protected static RKSHARP2.Controls.RKSTANDARDWRITER.RKLAYOUT ConstructContainer (System.Windows.Forms.Control Control_Temporary)
        {
            RKSHARP2.Controls.RKSTANDARDWRITER.RKLAYOUT Control_Container = new RKSHARP2.Controls.RKSTANDARDWRITER.RKLAYOUT();
            Control_Container.SuspendLayout();
            Control_Container.AutoSize = true;
            Control_Container.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            Control_Container.BackColor = System.Drawing.Color.Transparent;
            Control_Container.BackgroundImage = null;
            Control_Container.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            Control_Container.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.None;
            Control_Container.ColumnCount = 3;
            Control_Container.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100));
            Control_Container.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            Control_Container.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100));
            Control_Container.Dock = System.Windows.Forms.DockStyle.Fill;
            Control_Container.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
            Control_Container.Margin = new System.Windows.Forms.Padding(2);
            Control_Container.Padding = new System.Windows.Forms.Padding(0);
            Control_Container.RowCount = 3;
            Control_Container.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100));
            Control_Container.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            Control_Container.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100));
            Control_Container.Size = new System.Drawing.Size(0, 0);
            Control_Container.TabIndex = 0;
            Control_Container.TabStop = false;
            Control_Container.Visible = Control_Temporary.Visible;
            Control_Container.Controls.Add(Control_Temporary, 1, 1);
            Control_Container.ResumeLayout();
            Control_Container.PerformLayout();
            return Control_Container;
        }
        protected static void SetControlBuffer (System.IntPtr Pointer_Control, System.Int32 Integer_West, System.Int32 Integer_East)
        {
            RKSHARP2.Controls.RKWRITER.SetControlBuffer(Pointer_Control, Integer_West, Integer_East);
        }
        #pragma warning restore 1591
    }
    public sealed class RKQUESTIONWRITER : RKSHARP2.Controls.RKWRITER
    {
        public override System.Boolean Multiline
        {
            get
            {
                return true;
            }
            set
            {
                this.SuspendLayout();
                base.Multiline = true;
                this.RecreateHandle();
                this.ResumeLayout();
                this.PerformLayout();
                this.Invalidate();
            }
        }

        public RKQUESTIONWRITER ()
        {
            this.SuspendLayout();
            this.AcceptsReturn = true;
            this.AcceptsTab = true;
            this.AutoSize = true;
            this.DoubleBuffered = true;
            this.Margin = new System.Windows.Forms.Padding(0);
            this.MaxLength = 32768;
            this.Multiline = true;
            this.Padding = new System.Windows.Forms.Padding(0);
            this.PasswordChar = RKSHARP2.Constants.NULLZERO;
            this.ResizeRedraw = true;
            this.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.Text = null;
            this.UseSystemPasswordChar = false;
            this.Vertical = 8;
            this.Visible = true;
            this.WordWrap = true;
            this.SetControlProperties(null, false, new System.Drawing.Size(0, 0), null, false, true);
            this.ResumeLayout();
            this.PerformLayout();
        }

        #pragma warning disable 1591
        protected override void OnHandleCreated (System.EventArgs Object_Arguments)
        {
            base.OnHandleCreated(Object_Arguments);
            this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, System.Math.Max(this.FontHeight, this.Control_Secondary.PreferredSize.Height) * this.Vertical);
            RKSHARP2.Controls.RKQUESTIONWRITER.SetControlBuffer(this.Handle, this.Control_Secondary.PreferredSize.Width, 0);
        }
        protected override void OnPaint (System.Windows.Forms.PaintEventArgs Object_Arguments)
        {
            //RRK: I have no idea WTF is suddenly wrong here but Windows will not set margins in OnHandleCreated() if multiple controls are present.
            base.OnPaint(Object_Arguments);
            RKSHARP2.Controls.RKQUESTIONWRITER.SetControlBuffer(this.Handle, this.Control_Secondary.PreferredSize.Width, 0);
        }
        protected override void WndProc (ref System.Windows.Forms.Message Object_Message)
        {
            #pragma warning disable 0162
            switch (Object_Message.Msg)
            {
                default:
                {
                    base.WndProc(ref Object_Message);
                }
                break;
            }
            #pragma warning restore 0162
        }
        public override System.Drawing.Size MinimumSize
        {
            get
            {
                return RKSHARP2.Windows.WindowSystemController.CompareMaximumSizes(base.MinimumSize, this.SizeFromClientSize(new System.Drawing.Size(this.Control_Secondary.PreferredSize.Width, System.Math.Max(this.FontHeight, this.Control_Secondary.PreferredSize.Height))));
            }
            set
            {
                base.MinimumSize = value;
            }
        }
        public override System.Drawing.Size MaximumSize
        {
            get
            {
                return base.MaximumSize;
            }
            set
            {
                base.MaximumSize = value;
            }
        }
        public override System.Drawing.Size GetPreferredSize (System.Drawing.Size Struct_Proposed)
        {
            return base.GetPreferredSize(Struct_Proposed);
        }
        protected void SetControlProperties (System.String String_Startup, System.Boolean Boolean_IconView, System.Drawing.Size Struct_IconSize, System.Drawing.Bitmap Object_Bitmap, System.Boolean Boolean_NullView, System.Boolean Boolean_NullType)
        {
            this.Control_Secondary = new RKSHARP2.Controls.RKQUESTIONWRITER.RKLAYOUT();
            this.Control_Secondary.AutoSize = true;
            this.Control_Secondary.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.Control_Secondary.BackColor = System.Drawing.Color.Transparent;
            this.Control_Secondary.BackgroundImage = null;
            this.Control_Secondary.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.Control_Secondary.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.None;
            this.Control_Secondary.ColumnCount = 4;
            this.Control_Secondary.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100));
            this.Control_Secondary.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            this.Control_Secondary.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            this.Control_Secondary.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100));
            this.Control_Secondary.Dock = System.Windows.Forms.DockStyle.Left;
            this.Control_Secondary.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
            this.Control_Secondary.Margin = new System.Windows.Forms.Padding(0);
            this.Control_Secondary.Padding = new System.Windows.Forms.Padding(0);
            this.Control_Secondary.RowCount = 3;
            this.Control_Secondary.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100));
            this.Control_Secondary.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            this.Control_Secondary.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100));
            this.Control_Secondary.Size = new System.Drawing.Size(0, 0);
            this.Control_Secondary.TabIndex = 0;
            this.Control_Secondary.TabStop = false;
            this.Control_Secondary.Visible = true;
            this.Control_IconView = new RKSHARP2.Controls.RKQUESTIONWRITER.RKBITMAP();
            this.Control_IconView.AutoSize = false;
            this.Control_IconView.BackColor = System.Drawing.Color.Transparent;
            this.Control_IconView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.Control_IconView.Cursor = System.Windows.Forms.Cursors.Default;
            this.Control_IconView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.Control_IconView.Image = Object_Bitmap;
            this.Control_IconView.Margin = new System.Windows.Forms.Padding(0);
            this.Control_IconView.Padding = new System.Windows.Forms.Padding(0);
            this.Control_IconView.Parent = this;
            this.Control_IconView.Size = Struct_IconSize;
            this.Control_IconView.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.Control_IconView.TabIndex = 0;
            this.Control_IconView.TabStop = false;
            this.Control_IconView.Visible = Boolean_IconView;
            this.Control_IconView.VisibleChanged += new System.EventHandler(delegate(System.Object Object_Sender, System.EventArgs Object_Arguments){this.Control_IconView.Parent.Visible=this.IconView||this.NullView;});
            this.Control_NullView = new RKSHARP2.Controls.RKQUESTIONWRITER.RKFLIPPER();
            this.Control_NullView.AutoSize = true;
            this.Control_NullView.BackColor = System.Drawing.Color.Transparent;
            this.Control_NullView.Checked = true;
            this.Control_NullView.Cursor = System.Windows.Forms.Cursors.Default;
            this.Control_NullView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.Control_NullView.Enabled = !this.ReadOnly;
            this.Control_NullView.Margin = new System.Windows.Forms.Padding(0);
            this.Control_NullView.Padding = new System.Windows.Forms.Padding(0);
            this.Control_NullView.Parent = this;
            this.Control_NullView.Size = new System.Drawing.Size(0, 0);
            this.Control_NullView.TabIndex = 0;
            this.Control_NullView.TabStop = false;
            this.Control_NullView.Text = "";
            this.Control_NullView.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.Control_NullView.UseVisualStyleBackColor = true;
            this.Control_NullView.Visible = Boolean_NullView;
            this.Control_NullView.CheckedChanged += new System.EventHandler(delegate(System.Object Object_Sender, System.EventArgs Object_Arguments){this.ReadOnly=!this.Control_NullView.Checked;});
            this.Control_NullView.VisibleChanged += new System.EventHandler(delegate(System.Object Object_Sender, System.EventArgs Object_Arguments){this.Control_NullView.Parent.Visible=this.NullView||this.IconView;});
            this.Control_Secondary.SuspendLayout();
            this.Control_Secondary.Controls.Add(RKSHARP2.Controls.RKQUESTIONWRITER.ConstructContainer(this.Control_IconView), 1, 1);
            this.Control_Secondary.Controls.Add(RKSHARP2.Controls.RKQUESTIONWRITER.ConstructContainer(this.Control_NullView), 2, 1);
            this.Control_Secondary.ResumeLayout();
            this.Control_Secondary.PerformLayout();
            this.Controls.Add(this.Control_Secondary);
        } 
        protected static RKSHARP2.Controls.RKQUESTIONWRITER.RKLAYOUT ConstructContainer (System.Windows.Forms.Control Control_Temporary)
        {
            RKSHARP2.Controls.RKQUESTIONWRITER.RKLAYOUT Control_Container = new RKSHARP2.Controls.RKQUESTIONWRITER.RKLAYOUT();
            Control_Container.SuspendLayout();
            Control_Container.AutoSize = true;
            Control_Container.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            Control_Container.BackColor = System.Drawing.Color.Transparent;
            Control_Container.BackgroundImage = null;
            Control_Container.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            Control_Container.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.None;
            Control_Container.ColumnCount = 3;
            Control_Container.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100));
            Control_Container.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            Control_Container.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100));
            Control_Container.Dock = System.Windows.Forms.DockStyle.Fill;
            Control_Container.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
            Control_Container.Margin = new System.Windows.Forms.Padding(2);
            Control_Container.Padding = new System.Windows.Forms.Padding(0);
            Control_Container.RowCount = 3;
            Control_Container.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100));
            Control_Container.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize, 0));
            Control_Container.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100));
            Control_Container.Size = new System.Drawing.Size(0, 0);
            Control_Container.TabIndex = 0;
            Control_Container.TabStop = false;
            Control_Container.Visible = Control_Temporary.Visible;
            Control_Container.Controls.Add(Control_Temporary, 1, 1);
            Control_Container.ResumeLayout();
            Control_Container.PerformLayout();
            return Control_Container;
        }
        protected static void SetControlBuffer (System.IntPtr Pointer_Control, System.Int32 Integer_West, System.Int32 Integer_East)
        {
            RKSHARP2.Controls.RKWRITER.SetControlBuffer(Pointer_Control, Integer_West, Integer_East);
        }
        #pragma warning restore 1591
    }

除非你发布代码,否则我们将无法帮助你…我不得不删除很多属性,因为SO的限制非常小。基本上,文本框包含一个tablelayoutpanel,其中在页边空白处包含一个图标和一个复选框。两个控件都独立工作,所以我不认为这是错误的。我还注意到,如果我使用MultiLine return base.MultiLine而不是true/false,它会无缘无故地返回调用异常。陌生人和陌生人。如果我注释掉除构造函数以外的所有内容,它就可以工作了。第二次重写MultiLine时,即使它只是一个直接传递,它也会中断。好的,看起来它直接从MultiLine getter返回true。显然,我可以直接使用真/假来欺骗二传手,但这对二传手来说是不可能的。世界跆拳道联盟。