You can't just add an event and expect it to be automatically hooked up - if you want to respond to system events then the class needs to be one that knows about system events: a UserControl.
I quickly constructed one, and it works. Add a new UserControl, Call it "Resistor" and set it's CS code to this:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GeneralTesting
{
public partial class Resistor : UserControl
{
public Resistor()
{
InitializeComponent();
Text = "100R";
}
private void Resistor_Paint(object sender, PaintEventArgs e)
{
e.Graphics.FillRectangle(Brushes.Pink, e.ClipRectangle);
e.Graphics.DrawString(Text, Font, Brushes.Black, e.ClipRectangle);
}
private void Resistor_MouseEnter(object sender, EventArgs e)
{
Text = "Hello";
Invalidate();
}
private void Resistor_MouseLeave(object sender, EventArgs e)
{
Text = "100R";
Invalidate();
}
}
}
Drop one on my form in design mode, and run the app. when the mouse enters, it changes text, when the mouse leaves, it goes back.