Can Anyone tell me why this code does not work as expected?

  • Thread starter Thread starter David Linda
  • Start date Start date
D

David Linda

Guest
I am attempting to write a control that stores strings like a listbox or combobox. It should have the save look and feel as well
Imports System.Windows.Forms.Design
Imports System.Drawing.Design
Imports System.ComponentModel

<System.Serializable()> Public Class myControl

Private Sub myControl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Lines = myStrings.ToArray
End Sub

Private _myStrings As New List(Of String)
<Editor("System.Windows.Forms.Design.StringCollectionEditor," & _
" System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", _
GetType(System.Drawing.Design.UITypeEditor)), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
Public ReadOnly Property myStrings() As List(Of String)
Get
Return _myStrings
End Get
End Property

End Class
I have been chatting with other people in other .net forums, and the code above is the closest to what I want. But when the app that uses this code is shut down, the data I enter is lost. I could write the data to an xml file no problem, but then how do I get the string data from the .xml into the string editor dialog
David Linda

Continue reading...
 
Back
Top