Hey, this is just a throw out to all the techies here in the forums. I do most of my coding in C#, but I do answer a lot of questions in VB.Net and recently I find myself increasingly frustrated by the lack of an exposed Program class in VB.Net Windows Forms Applications.
The reason I find this irritating is mainly in the case of questions about user validation. As i'm sure many of you already know and do, the best practice for user validation is not to run the program at all unless the user has been validated.
Hypothetically, in a VB.Net application, the Sub Main() would probably look something like this:
Unfortunately, unlike in C#, i've been completely unable to expose Sub Main() in VB.Net. Have any of you managed, or heard of a way to expose or override this sub in VB.Net?Code:Module Program Sub Main() Application.EnableVisualStyles() Application.SetCompatibleTextRenderingDefault(False) Dim success As Boolean Using login As New LoginForm success = (login.ShowDialog() = Windows.Forms.DialogResult.OK) End Using If success Then _ Application.Run(New MainForm()) End Sub End Class





Reply With Quote