While/by/in doing something

In French this is achieved through the following formula:

en + present participle (in English the part of the verb ending in "ing")

To find the present participle in French (for regular verbs), take the "nous" form of the present tense, remove the "ons", and 
add "ant".

e.g.         er verbs regardant, entrant, travaillant

              re verbs vendant, rendant, attendant

              ir verbs finissant, choisissant, punissant

This rule applies to many irregular verbs as well, although there are several notable exceptions:

e.g.             avoir ayant

                  être étant

                  savoir sachant



Grammar links