Hi kana250688,
You are getting the error because you are trying to convert directly bool to an integer type using the Explicit way like you are using below.
kana250688 says:
height = (
int
)(y > clientSize.Height - 5);
You should use ToInt32 method of Convert class like below.
height = Convert.ToInt32(y > clientSize.Height - 5);
It will return 0 or 1 based on the boolean value returning from condition.