2 番目のタグ (またはユーザー定義の int/string/float を割り当てることができる他の何か) を取得する可能性はありますか?
その理由は、私はすでに ButtonX.Tag を使用しており、配列などに 2 番目の int を配置するよりも、2 番目のタグなどを使用する方がはるかに簡単だからです...
前もって感謝します。
独自のクラスを作成し、そのオブジェクトをボタン タグにアタッチするとよいでしょう。
class ButtonProperty
{
public int ID { get; set; }
public string MyProperty { get; set; }
}
次に、次のように使用できます。
ButtonProperty buttonPropertyObj = new ButtonProperty () { ID = 1, MyProperty ="Some property"};
btn1.Tag = buttonPropertyObj;
そのためにタプルを使用することもできます
ButtonX.Tag = new Tuple<int, string>(12, "");