<p>It can be either at compile time or at run-time using a config file.  Is there a more elegant way than simple (and many) if statements?</p>

<p>I am targeting especially sets of UI controls that comes for a particular feature.</p>

Unless your program must squeeze out 100% performance, do it with a config file.  It will keep your code cleaner.
If one option changes many parts of code, don't write many conditionals, write one conditional that picks which class you delegate to.  For instance if a preference picks TCP versus UDP, have your conditional instantiate a TcpProvider or UdpProvider which the rest of your code uses with minimal muss or fuss.