D
Doug Bell
Hi,
I am trying to learn VB.Net by following some examples.
I am not sure I am following the order of events but could someone confirm:
Project "ScheduleFileTfr" has property "Startup Object:" set to "FormMain"
FormMain has code:
Public Shared Sub Main()
Dim initForm As New MainForm
Application.Run()
End Sub
initForm declares an instance of the Class MainForm
What does Application.Run() do?
Next Procedure to run is "Public Sub New()"
I assume this runs because the "MainForm" is set as a startup parameter of
the project.
It doesn't run if it isn't declared.
Then the procedure Public Sub New runs:
Public Sub New()
MyBase.New()
'This call is required by the Win Form Designer.
InitializeComponent()
'This form isn't used directly so hide it immediately.
Me.Hide()
'Retrieve settings from the registry.
dacGetRegSettings()
'Setup the tray icon.
InitializeNotifyIcon()
End Sub
InitializeComponent() calls procedure to set default parameters of the form
Me.Hide hides the form. What is the difference between hiding the form and
setting its property Visible = False ?
dacGetRegSettings() is a procedure in a module that I wrote to retrieve some
registry keys and save them as public variables
InitializeNotifyIcon() is a (sample) procedure that initialised an icon and
menu in the Systray.
Is this why the Application.Run is required?
When I tried to add some code to check for a second instance of the process
running, I could detect it but Application.Exit wouldn't (self) terminate
the application.
I can certainly see the power of VB.Net but I am really struggling to get on
top of it any recomendations for good books? I have not had much to do with
OOP before.
Thanks
Doug
I am trying to learn VB.Net by following some examples.
I am not sure I am following the order of events but could someone confirm:
Project "ScheduleFileTfr" has property "Startup Object:" set to "FormMain"
FormMain has code:
Public Shared Sub Main()
Dim initForm As New MainForm
Application.Run()
End Sub
initForm declares an instance of the Class MainForm
What does Application.Run() do?
Next Procedure to run is "Public Sub New()"
I assume this runs because the "MainForm" is set as a startup parameter of
the project.
It doesn't run if it isn't declared.
Then the procedure Public Sub New runs:
Public Sub New()
MyBase.New()
'This call is required by the Win Form Designer.
InitializeComponent()
'This form isn't used directly so hide it immediately.
Me.Hide()
'Retrieve settings from the registry.
dacGetRegSettings()
'Setup the tray icon.
InitializeNotifyIcon()
End Sub
InitializeComponent() calls procedure to set default parameters of the form
Me.Hide hides the form. What is the difference between hiding the form and
setting its property Visible = False ?
dacGetRegSettings() is a procedure in a module that I wrote to retrieve some
registry keys and save them as public variables
InitializeNotifyIcon() is a (sample) procedure that initialised an icon and
menu in the Systray.
Is this why the Application.Run is required?
When I tried to add some code to check for a second instance of the process
running, I could detect it but Application.Exit wouldn't (self) terminate
the application.
I can certainly see the power of VB.Net but I am really struggling to get on
top of it any recomendations for good books? I have not had much to do with
OOP before.
Thanks
Doug