Many scholars today will say if an unrelated woman walks infornt of a man he should lower his gaze. But thats not true. Lowering the gaze only refers to if you have a lustful feeling towards that person. A person can't have any lust towards a woman who's wearing hijab, as Ibn Katheer wrote it's permissble to look at a woman's hands and face (though of course not unnecessarily). So who does this refer to then? Well I'm going to be a little harsh. These shameless Western women who have no respect for themselves or their surroundings (NOTE: I DO NOT MEAN ALL WESTERN WOMEN. JUST THE ONES WHO DRESS PROVOCATIVELY). It's mandatory for Muslim males to lower their gazes when these woman are around.
To expand on this I'll post a fatwa from Sunni Path (affiliated with the Muslim Village site).
This also kind of relates to the topic, if one used to interact with a particular opposite gender like a friend, and then the person's character changes, they basically end up cutting off ties with this person without explaining to them why, is this the right approach? What if that person harbors ill will in their hearts toward the Muslim who used to be their friend. What should a muslim do in this case?
May Allah Talla forgive everyone at SunniPath for their past sins, may he grant all of you Jannah Al-Fardos, and a long healthy life and protection from calamities. Ameen
(should one say Insh'Allah after a dua' like this).
In the Name of Allah, Most Gracious, Most Merciful.
I pray this message finds you in good health and strong iman.
I apologize for taking so long to reply.
Thank you for your question.
I appreciate your concerns. Navigating college campuses poses certain challenges to practicing Muslims. Nevertheless, I am confident that you can rise to these challenges and figure out the best way to deal with the abovementioned issues.
1. On the issue of repenting and saying "Astaghfirullah" when you see a woman:
It's a good practice for all Muslims to make istighfar, that is, seek Allah's forgiveness, even when they haven't done anything wrong. The Prophet, Allah bless him and give him peace, used to seek Allah's forgiveness one hundred times a day, and he was protected from sin! Seeking forgiveness softens one's heart and helps to heal its diseases.
However, you don't have to seek forgiveness if you happen to see a woman. There's nothing wrong with happening to glance in someone's direction. The scholars say that the first look is allowed because it's unintentional. After that, you should lower your gaze. But please note that a measure of common sense is called for. What are your intentions in looking? Obviously you're not trying to bother the women. So why get agitated when you see them? There's no way you can function on a college campus and not see women. What's important is that you follow the adab of interaction with the opposite sex. Lower your gaze, be modest, and maintain a polite distance. Also keep in mind that lowering your gaze does not mean keeping your eyes glued to the floor. It means averting your gaze from women who are not dressed properly and avoiding any type of staring or ogling.
According to an answer by Shaykh Faraz Rabbani, "In the Hanafi school, it is permitted (though disliked without need) for a man to look towards the face or hands of a woman, and for a woman to look towards the non-nakedness of a man, if there is no fear of desire or physical inclining." Please see the complete answer at http://qa.sunnipath.com/issue_view.asp?HD=1&ID=2451&CATE=143
Keep in mind that it is permissible to look at a woman's face and hands if there is a need, and as long as you look without desire. In other words, just be respectful. It's a given that you will have to interact with female college professors and your fellow classmates. This brings me to the second part of your question.
2. May Allah Most High reward you for your sincere efforts in His path. Please keep in mind that Allah does not place on us a burden greater than we can bear. You have to function effectively in your environment. As a student, you have to interact with your fellow classmates, male and female. There is nothing wrong with being friendly to the women in your class. And there is no need to ignore them. As Muslims, we are enjoined to treat everyone with dignity, kindness, and respect. You can behave modestly and still be polite with people. Don't put yourself in a position where you can't ask for help or get someone's notes if you need to.
3. Some general advice for dealing with women on campus: Brothers need to be careful about how they come off when dealing with women. Let me give you an example. When I was in school a few years ago, there were brothers who made a big deal of maintaining their distance from women. Whenever they saw a woman, they would scowl and turn their backs. They never greeted any of the women, Muslim or otherwise. Some non-Muslim students observed this and came away with a bad impression of gender relations in Islam.
Remember: your behavior can be a powerful statement about Islam, particularly to non-Muslim women. You want to be a good example of dawah, or calling to the way of Allah. This is difficult to achieve if one does not exercise basic courtesy with people, regardless of their gender.
As Ustadha Shazia Ahmad said in a previous answer, "dont think that you have to be cold to the opposite sex, for Muslims that hold contempt for one another does not make for a unified ummah." You can view the complete answer at http://qa.sunnipath.com/issue_view.asp?HD=7&ID=7940&CATE=3600
4. Dealing with former non-Muslim friends: This is a situation that requires some amount of tact. Once again, you have to strike a balance. Islam discourages free intermingling of the sexes. However, this doesn't mean that you have to give people the cold shoulder. If the person in question seemsupset, then explain to them in a nice way that you are not trying to hurt their feelings, but rather, you are trying to respect their space and privacy. Don't go from being really friendly to complete avoidance. A courteous greeting and an inquiry after their health can go a long way in dispelling ill will. After that, just keep on going.
Last but not least,here is agood article on SunniPath:
Gender Interaction On Campusat
May Allah Most High bless you in yourefforts and give you tawfiq in your studies.
And Allah knows best.