如何使多個參數多於兩個? CustomButtonClickEventArgs被許多地方共享,我不想修改。如何將表示ComboBox位置的ActiveRow和ActiveCol參數添加到ComboBoxCustomButtonClick事件中,如下所示,我期望的是什麼?具有多個參數的C#事件
private void MyUC1_ComboBoxCustomButtonClick(object sender, MyUC.CustomButtonClickEventArgs e, int ActiveRow, int ActiveCol)
聲明:
public class CustomButtonClickEventArgs : EventArgs
{
public readonly int Index;
public readonly string Key;
public readonly string Tag;
public readonly Keys ModifierKeys;
public CustomButtonClickEventArgs(int index, string key, string tag, Keys modifierKeys)
{
this.Index = index;
this.Key = key;
this.Tag = tag;
this.ModifierKeys = modifierKeys;
}
}
public delegate void CustomButtonClickEventHandler(object sender, CustomButtonClickEventArgs e);
ComboBox located in Grid Cell(1,1)
你可以添加一個裝飾器/包裝到CustomButtonClickEventArgs添加ActiveRow和ActiveCol參數? – Andrew