Hello,

In order to be able to draw a border around a DataAdapter, I've created a class that inherits from DataAdapter and draws a border around a DataAdapter, making the class a customozied component.
Next, I'd like to be able set it up so that when it gets resized along with the other components on the Form, that it will resize in proportion to the size of the Form.

I've read about how, in general, to resize (or re-scale) a component, one way is to set the Anchor property AnchorStyles.Top, AnchorStyles.Bottom, etc. However, in this case, it doesn't seem to work.

Below is the code for the customized DataAdapter. You can see some different things that I've tried. I'm fairly new to C#. Any ideas or hints would be helpful. Thanks.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace DataAdapterWithBorder
{
public class DataAdapterWithBorder : DataGridView
{
int BORDER_SIZE = 6;


protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
ControlPaint.DrawBorder(e.Graphics, ClientRectangle,
Color.Blue, BORDER_SIZE, ButtonBorderStyle.Solid,
Color.Blue, BORDER_SIZE, ButtonBorderStyle.Solid,
Color.Blue, BORDER_SIZE, ButtonBorderStyle.Solid,
Color.Blue, BORDER_SIZE, ButtonBorderStyle.Solid);



// Anchor =
// AnchorStyles.Bottom |
// AnchorStyles.Right |
// AnchorStyles.Top |
// AnchorStyles.Left;

// Dock = DockStyle.Fill;

//ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle,
// Color.Orange, ButtonBorderStyle.Solid);

}

}
}