Lately when people invite me for a wedding reception example, where we going to meet with a lot of people either male or female, since I am not good handling my eyes, I mean if see beautiful girl, their dress example I might see it and I know it is haram but I do it.
Due to that condition I decide not to attend any wedding reception by giving excuses and just wishing thanks or goodluck or something to them personally. Am I doing a right thing?

Yes. You are doing the right thing