Thursday, 22 August 2013

Change String in another Class as Parameter in Sub

Change String in another Class as Parameter in Sub

I have Class1 where i set a String: Public Str as String. The Form1_Load
event fills the string with a default value "C:". If the user wants to
change this default path he can use a FolderBrowserDialog. I have a sub
(in Class From1) since there are 5 Paths the user is able to change.
I want the Str variable to be filled with the new string, so i tried
Public Sub DialogOpener(ByRef SetTextbox As TextBox, newstring as String)
FolderBrowserDialog1.ShowDialog()
Dim Path As String = FolderBrowserDialog1.SelectedPath
SetTextbox.Text = Nothing
Dim RIm As New RImport
RIm.newstring = newstring
SetTextbox.Text = Path
End Sub
But "RIm.str = newstring" is not working. And i have no idea what i do wrong.

No comments:

Post a Comment