A compliment does
!= hitting on you.
If someone tells you that you're pretty, or that they like your boots, or that you're wearing a nice necklace/dress/pair of jeans, and your response is "I have a boyfriend" or some other means of expressing "I reject your implied advance" you are A) self-absorbed B) kind of a bitch C) bad at this whole social interaction thing.
It is possible that you can mistake someone's genuine compliment for an advance. This happens. However, responding in a way that communicates "You're not in my league and your advance is unappreciated" when you're not 99% sure that's what it was just makes you a terrible person. That poor guy was just trying to be nice. And/or nattering about something that caught his eye. I wanted to punch you for being such a bitch, for him.
K.