So, you’re designing your InfoPath form and as soon as you click on some field to manipulate it with code, Visual Studio comes up and you notice that the language used for your code is not the one you were going for. Well, if you were going for C# you definitely did not get what you were going for.
InfoPath code defaults to Visual Basic and the application never asks you for your preference. So, how do you change that?
Well, it’s actually a straightforward option and it resides exactly where you would have thought it would.
Click on “File”, then “Options”, then click on “More Options” under the title “InfoPath Options” and then click on the “Design” tab in the new window that opens up.
The default programming language is listed in the “Programing Defaults” section of the new window. You can even select the location where your code will be stored.
Change the defaults to your liking and click on OK. That’s all. Next time you attempt to add code to your InfoPath forms, Visual Studio will kick off with your preferred programming language.