none
this Code did not work

    Question

  • Public Class Memory
        Inherits System.Windows.Forms.Form
        
        Private Sub Memory_Load(sender As Object, e As EventArgs) Handles MyBase.Load
           
            '   SaveMemoryButton
            Me.SaveMemoryButton.Text = "Save Memory"
            Me.SaveMemoryButton.Name = "SaveMemoryButton"
            Me.SaveMemoryButton.Size = New System.Drawing.Size(106, 31)
            Me.SaveMemoryButton.Location = New System.Drawing.Point(228, 254)
            Me.SaveMemoryButton.BackColor = Color.Green
            Me.SaveMemoryButton.ForeColor = Color.Black
            '    LoadMemoryButton
            Me.LoadMemoryButton.Name = "LoadMemoryButton"
            Me.LoadMemoryButton.Text = "Load Memory"
            Me.LoadMemoryButton.Size = New System.Drawing.Size(106, 31)
            Me.LoadMemoryButton.Location = New System.Drawing.Point(340, 254)
            Me.LoadMemoryButton.BackColor = Color.Green
            Me.LoadMemoryButton.ForeColor = Color.Black
            '     ListBox1
            Me.listbox1.Name = "ListBox1"
            Me.listbox1.Text = "ListBox1"
            Me.listbox1.BorderStyle = System.Windows.Forms.BorderStyle.None
            Me.listbox1.FormattingEnabled = True
            Me.listbox1.Location = New System.Drawing.Point(0, 1)
            Me.listbox1.Size = New System.Drawing.Size(449, 247)
            Me.listbox1.TabIndex = 1
            '    AddItemButton
            Me.AddItemButton.Name = "AddItemButton"
            Me.AddItemButton.Text = "Add Item"
            Me.AddItemButton.Size = New System.Drawing.Size(106, 31)
            Me.AddItemButton.Location = New System.Drawing.Point(116, 254)
            Me.AddItemButton.BackColor = Color.Green
            Me.AddItemButton.ForeColor = Color.Black
            '    Form
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.Size = New System.Drawing.Size(468, 327)
            Me.MaximizeBox = False
            Me.MinimizeBox = False
            Me.Name = "Memory"
            Me.ShowIcon = False
            Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
            Me.Text = "Memory"
            Me.ResumeLayout(False)
            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            Me.Controls.Add(SaveMemoryButton)
            Me.Controls.Add(LoadMemoryButton)
            Me.Controls.Add(AddItemButton)
            Me.Controls.Add(listbox1)
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
        End Sub
    
        Private Sub SaveMemoryButton_click(ByVal sender As Object, e As EventArgs) Handles SaveMemoryButton.Click
            '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    
            '     <<<<<<<<<<<<<<   This Code did not work  , Why ????? >>>>>>>>>>>>>>>>>>>>>>>>
            My.Settings.Mem = listbox1
            My.Settings.Save()
    
        End Sub
      
        Private Sub LoadMemoryButton_Click(sender As Object, e As EventArgs) Handles LoadMemoryButton.Click
          
            listbox1 = My.Settings.Mem
            '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
        End Sub
    
        Private Sub AddItemButton_Click(sender As Object, e As EventArgs) Handles AddItemButton.Click
            Me.listbox1.Items.Add("Hello World")
        End Sub
    
        Friend WithEvents SaveMemoryButton As New Button
        Friend WithEvents LoadMemoryButton As New Button
        Friend WithEvents AddItemButton As New Button
        Friend WithEvents listbox1 As New ListBox
    End Class





    Tuesday, July 26, 2016 8:45 PM

Answers

All replies