Should I create a Control Class rather than use a Module for MVC?
So I'm a little new to MVC. I'm trying to use it in writing VB.NET Windows Form code.
So I'm thinking, instead of using a VB.NET module, or having code embedded in the forms, I should create my own "Control" Class, to handle all operations and "application" level variables.
Is this the right approach?
Ex:
Code:
Private Sub frmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
goControl = New MyControlClass()
goControl.sUserID = txtUser.text
goControl.sPass = txtPass.text
goControl.login()
Dim lfTemp as New frmMainForm
lfTemp.show()
me.Close()
End Sub
Re: Should I create a Control Class rather than use a Module for MVC?
vb Code:
Dim goControl as myControlclass
goControl = New MyControlClass()
goControl.sUserID = txtUser.text
goControl.sPass = txtPass.text
goControl.login()
Dim lfTemp as New frmMainForm
lfTemp.show()
me.Close()
Looks alright to me. Using classes is an OOP/OOD way to go with .Net
Oh, I added a declaration that then is followed by instantiating a NEW class of the Usercontrol.
You prob already added that elsewhere though, eh?
Good LUCK!~