protected virtual void OnBitClicked(BitClickedEventArgs e) { EventHandler <BitClickedEventArgs> handler = BitClicked; if (handler != null) { handler(this, e); } }
private void bitClicker1_BitClicked(object sender, BitClickedEventArgs e) { var message = string.Format("Число:{0,5}\nБит:{1,5}\nЗначение бита:{2,5}", e.Number, e.Bit, e.BitValue); switch (e.MouseEventArgs.Button) { case MouseButtons.Left: bitClicker1.CurrentBitValue = 1; break; case MouseButtons.Right: bitClicker1.CurrentBitValue = 0; break; } }