Databases and Buttons

  • Thread starter Thread starter Zahid
  • Start date Start date
Z

Zahid

Hi,

Anybody know how to save a Button into an SQLServerCe
database field? Or any other Control?

Thanks in advance.
 
Create fields that would contain defining properties of your controls:
X, Y, Width, Height, Text, optionally, color, control type (e.g. a string
that is the class name: myControl.GetType().FullName)

When restoring, do something like this:
Control c = (Control)Activator.CreateInstance(Type.GetType(typeName));
Control.Location = new Rectangle(X, Y, Width, Height);
Control.Text = text;
etc.
 
Back
Top