Client code behind through VSTA (Visual Studio for Applications, and it is not full-pledged Visual Studio... though it is off-topic), which is accessed/created through Developer button on ribbon in Infopath Designer is not available for Sharepoint List Form type (Compatibility < Form Oprions < Info < File) of Infopath template
Check also my answer to question "Custom Code is disabled on my form/(it is a workflow form of a sp list workflow process)/ any workaround?"
Update:
In "Table 3. Comparing form library and list templates" of MSDN article
you can find it under entry "Is there support for custom code?"
Note that it is about Sharepoint List Form type of Infopath template. You can bind controls to sharepoint list(s) and engage code-behind in other types of Infopath templates.