フォームに4つのボタンがあるとします。 5秒ごとにこれらのボタンの背景色がランダムに変化します(ただし、同じままでもかまいません)。 バックグラウンドを変更したボタンだけを取得するにはどうすればよいですか?2つのリストを比較するプロパティの前/後
List<Button> oldList;
oldList = new List<Button>();
foreach (Button item in Controls.OfType<Button>())
{
//First we catch all the buttons' instances at for e.g 12:00
oldList.Add(item);
}
buttonsChangeColor(); //Five seconds later some buttons change their bg color
List<Button> newList = new List<Button>();
foreach (Button item in Controls.OfType<Button>())
{
//2nd we catch all the buttons' instances at for e.g 12:05 after some of theme changed color
newList.Add(item);
}
//HOW CAN I COMPARE THESE 2 LISTS BASED ON THE BACKGROUNDCOLOR ? If it has changed or not
変更で実際のリストのために、さらに 'New'ポスト' WHERE'を選択することもできます!!!! – Niiw
@IUSw大歓迎です。 :-) – haindl
@Newwあなたが知らない場合に備えて:もしそれが助けられたならば、回答をupvoteすることもできます。 ;-) – haindl