The code you show looks just like the example you took it from - which being MSDN means it should work.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.haschildren.aspx[
^]
There are two possibilities I can think of immediately:
1) It is doing exactly what it should, but none of your controls have had the Fore- or Back- Color property changed from the deafult, so it doesn't show up as doing anything.
2) You aren't calling the method with teh correct control in the first instance, so it doesn't reach any controls with a modified Fore- or Back- Color property.
Try calling it from a Button.Click event handler, and call the method like this:
ResetAllControlsBackColor(this);
Which will affect every control in the form (including the form itself)