My current WinForms project needs to launch from Sub Main(); in order to do this, one must un-check the 'Enable Application Framework' option in the Application tab of 'My Project'.
The Sub Main that I have looks like this...
<System.STAThread()>
Public Shared Sub Main()
Application.EnableVisualStyles()
'Application.SetCompatibleTextRenderingDefault(True)
Application.SetCompatibleTextRenderingDefault(False) 'Fix from Hans Passant
'Application.DoEvents() 'removed per suggestion
Application.Run(New p2Login(p2user))
If p2user.isValidated Then
Application.Run(New frmMAIN)
End If
End Sub
The specific problem that I am facing is that using this configuration causes subtle control layout differences. For example, some of my labels are now slightly overlapping their controls, and in-line checkboxes seem to shift slightly to the left. I'm sure there are other differences that aren't immediately apparent.
Points: 1) Visual Style does appear on controls such as buttons. 2) The layout problems go away if I re-check the "Enable Application Framework", and set a startup form.