There could be many reasons for this. A few that come up quickly to my mind:
- Did you call this routine AFTER
InitializeComponent()
?
- Is the path syntax you are using correct? Does it work if you try it in the debugger? Try using backslash (\) instead of Slash (/) and see.
- This may be due to side-effects of some other code in your form. Try using the same code in a blank Form (with just the constructor and this function) and check.