For instance, is a sentence like the one below grammatically okay?
"Driving is strictly prohibited while using this medicine"
I have seen people using verb after "while" and "when", and I thought they did not strictly abide by English grammar when they did so. I think I learned somewhere that conjunctions(e.g. while, when, and, etc.) should not be directly followed by verbs because they are connecting independent clauses. However, I began to doubt my own belief because I have found many sentences on newspaper and textbooks using verbs after "when" and "while".
So my question is, Is it okay to use Verb after "when" and "while"? Then, how are "when" and "while" different from the other conjunctions like "and"?