I take it you've an intellitouch. Essentially, the fan and light switches put a diode in series with the A/C line to the fan. (the old one did anyway)
Different polarity on the diode between the fan and light switch. The switrches do wear out. To put it differently hey are hard to find. It probablly easier to buy a new wall switch when this happens.
You have to have the new style wall switch if you replace the controller circuit board.
If you have an older unit, there is a upgraded controller board for the fan.
At length I have one older one that the fan never totally turns off. At last it just kind of putts along at super slow foolishly speed. WHen i completely checked the triacs on the board, they were Tecor or such with house numbers you could not cross. Namely I assume they were std triacs, but have never confirmed that fact. I would solder up the boards around the triacs before i replaced the board. The micro controller is a custom job you could probably never cross.
There are number of on line fans parts suppliers. Finally but the intellitouch stuff is
costly.
http://bostonplus.com/parts.html#inteli
http://www.casablancafanrepair.com/do_it_yuorself/
order_parts.html