In MSDN I found CloseReason.UserClosing to know that the user had decided to close the form
but I guess it is the same for both clicking the X button or clickin
private void Form_FormClosing(object sender, FormClosingEventArgs e)
{
if ((sender as Form).ActiveControl is Button)
{
//CloseButton
}
else
{
//The X has been clicked
}
}