Im new to VB.net and programming in general. I really need some help with my sub routines.
Basicall what i have is a list of buttons. Each button takes two textboxes and does something (they all do the same thing).
What I'm trying to do is instead of writing code for each button click... I want to call a sub routine that will do the task. But i need it to someone how take the data from the textboxes (textbox1.text) along with it in order to run the task in the subroutine.
The click button click currently looks like whats below.. There are data from two text boxes that needs to go with it and They are textbox1.text and textbox2.text :
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DM1.Click
And it calls Thissub routine:
Private Sub MigrateUserData()
Dim p As New Process()
p.StartInfo.FileName = "C:\pstools\psexec.exe"
p.StartInfo.Arguments = "\\" & TextBox1a.Text & " -s cmd /c c:\userMigration\scanstate.exe c:\%user% /o /all /c /i:migapp.xml /i:miguser.xml /i:migsys.xml /nocompress /localonly"
p.StartInfo.CreateNoWindow = True
RichTextBox1.Text = "User Data Migration Started Sucessfully."
RichTextBox1.BackColor = Color.LightGreen
Catch ex As Exception
RichTextBox1.Text = "Coudn't Not Start User Data Migration. Check if the systems is online."
RichTextBox1.BackColor = Color.OrangeRed
It currently works just fine but only for the static (TextBox1a.Text) textbox. I think something have to be changed in the sub routine but im not sure what or how..