ふらっとC♯(Part5)
■ このスレッドは過去ログ倉庫に格納されています
0391デフォルトの名無しさん
NGNG問答無用に全部コピーすると問題が出たりするしな(だから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);
}
}
■ このスレッドは過去ログ倉庫に格納されています