mercredi 23 avril 2014

TextBox - ne peut pas avoir 2 zones de texte dérivé de résumé sur le même WinForm ? -Débordement de pile


OK, this is a weird problem. I have an abstract control that derives from TextBox called Writer, and two classes that derive from it, StdWriter and LngWriter. The difference between them is one is always multiline and the other is not. That's seriously the only difference between the two.


In the OnHandleCreated function, I set the margins with the Win32 SendMessage function. I do it again in OnPaint because WinForms will "forget" to set the margins if I have more than 1 StdWriter (or any derived textbox type) on the same form (this makes no sense either but at least I have a workaround for it).


Now I have the problem that I can't have both of these textboxes on the same form. If I put a StdWriter and a multiline TextBox or a LngWriter and a standard TextBox on the form, it works. If I put 2 MS textboxes on the form, it also works. but let me put a LngWriter and StdWriter together and the LngWriter won't draw its scrollbar right (the vertical is wrong and it just won't draw the horizontal, period) or accept the Enterkey, despite both MultiLine and AcceptsReturn returning true. I can't even paste newlines in because it totally strips them out.


I don't understand this because TextBox derives from the abstract TextBoxBase and I don't have any problems with dozens of different derived textboxes all over my forms. Is it because I'm inserting a second abstract class in the inheritance chain and Visual Studio doesn't like it or what?


    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
}


OK, this is a weird problem. I have an abstract control that derives from TextBox called Writer, and two classes that derive from it, StdWriter and LngWriter. The difference between them is one is always multiline and the other is not. That's seriously the only difference between the two.


In the OnHandleCreated function, I set the margins with the Win32 SendMessage function. I do it again in OnPaint because WinForms will "forget" to set the margins if I have more than 1 StdWriter (or any derived textbox type) on the same form (this makes no sense either but at least I have a workaround for it).


Now I have the problem that I can't have both of these textboxes on the same form. If I put a StdWriter and a multiline TextBox or a LngWriter and a standard TextBox on the form, it works. If I put 2 MS textboxes on the form, it also works. but let me put a LngWriter and StdWriter together and the LngWriter won't draw its scrollbar right (the vertical is wrong and it just won't draw the horizontal, period) or accept the Enterkey, despite both MultiLine and AcceptsReturn returning true. I can't even paste newlines in because it totally strips them out.


I don't understand this because TextBox derives from the abstract TextBoxBase and I don't have any problems with dozens of different derived textboxes all over my forms. Is it because I'm inserting a second abstract class in the inheritance chain and Visual Studio doesn't like it or what?


    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
}

0 commentaires:

Enregistrer un commentaire