Presumably this is because water is rising too high and reaching the level of the overflow outlet. If the overflow pipe still drips after replacing the ballcock, check first that the ball on the end of the lever can move unrestricted in the tank and there isn't anything obstructing it. If you didn't replace the ball float, this could be punctured, slowly letting in water and partially full. The result is that water would need to rise higher to create sufficient force to close the valve. Another possibility is that adjustment is necessary because the new ballcock has a different length arm. If it has an adjustment screw, turn this anti-clockwise or clockwise so that the valve shuts off when the water has reached a lower level.