What do you mean with "flush with the..."? I am not able to repro that
on a .NET 1.0 machine running Windows XP Professional.
My dev machine: Win XP Home, .NET 1.0, VS 2002
Here is an example. When the form is restored (un-minimized), the
rich text box has changed - the position within the form is the same,
but the size is bigger. The text box extends to the right and bottom
edges of the form, possible going underneath any buttons etc. on the
form. At least it does on my development machine - haven't tried it
anywhere else.
I worked around it by resizing the rich text box manually on Restore.
Very silly, but it works.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace RichTextTest
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.RichTextBox richTextBox1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components =
null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after
InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not
modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.richTextBox1 = new
System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.Anchor =
(((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Bottom)
|
System.Windows.Forms.AnchorStyles.Left)
|
System.Windows.Forms.AnchorStyles.Right);
this.richTextBox1.Location = new
System.Drawing.Point(40, 40);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new
System.Drawing.Size(208, 176);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "richTextBox1";
//
// Form1
//
this.AutoScaleBaseSize = new
System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292,
266);
this.Controls.AddRange(new
System.Windows.Forms.Control[] {
this.richTextBox1});
this.Name = "Form1";
this.Text = "Form1";
this.WindowState =
System.Windows.Forms.FormWindowState.Minimized;
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}