Resources file

Posted 16 February 2013 - 07:33 AM

Hi all,
I'm trying to populate a combo box from a text file I created in Resources. I know how to populate from a text file using StreamReader but not sure how to do it using a resource file. This is how I do it with the StreamReader...

Re: Resources file

Posted 16 February 2013 - 08:47 AM

Please read the link that andrewsw has given so you can understand it a little better. After that i am guessing you will be back to find out how to get rid of the newline character that is printed in the combobox. There may be a better way to do it but, here is an example of how i have done it before :

Chr(10) is the ascii value for newline.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lines() As String = My.Resources.test.Split(vbCrLf)
For Each line In lines
ComboBox1.Items.Add(line.Trim(Chr(10)))
Next
End Sub