- 391 名前:デフォルトの名無しさん mailto:sage [04/10/17 23:36:11]
- 意外に必要なプロパティなんて少ないもんだぞ。
問答無用に全部コピーすると問題が出たりするしな(だからWindowTargetをわざわざ除外してる)。 public void CopyButton(System.Windows.Forms.Button from, System.Windows.Forms.Button to) { foreach (System.Reflection.PropertyInfo inf in typeof(System.Windows.Forms.Button).GetProperties()) { if (!inf.CanRead || !inf.CanWrite || inf.Name == "WindowTarget") continue; inf.SetValue(to, inf.GetValue(from, null), null); } }
|

|