public DrivetrainLayoutForm(RobotDataManager robotDataManager) { this.robotDataManager = robotDataManager; InitializeComponent(); controls.Add(RigidNode_Base.DriveTrainType.TANK, tankOption); controls.Add(RigidNode_Base.DriveTrainType.H_DRIVE, hdriveOption); controls.Add(RigidNode_Base.DriveTrainType.CUSTOM, customOption); foreach (var keyValuePair in controls) { WinFormsUtils.RecursiveControlNavigator(keyValuePair.Value, control => control.MouseDown += (sender, args) => SelectType(keyValuePair.Key)); WinFormsUtils.RecursiveControlNavigator(keyValuePair.Value, control => control.MouseEnter += (sender, args) => { if (driveTrainType != keyValuePair.Key) { keyValuePair.Value.BackColor = HoverColor; } }); WinFormsUtils.RecursiveControlNavigator(keyValuePair.Value, control => control.MouseLeave += (sender, args) => { if (driveTrainType != keyValuePair.Key) { keyValuePair.Value.BackColor = DefaultColor; } }); } SelectType(robotDataManager.RobotBaseNode.driveTrainType); }