Results 1 to 10 of 10

Thread: [RESOLVED] Form sharing problem

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    England
    Posts
    79

    Resolved [RESOLVED] Form sharing problem

    Form2 is not passing over information to Form1...

    Code for Form2:

    VB Code:
    1. Private m_myVar As String
    2.  
    3. Public Property listItem() As String
    4.   Get
    5.     Return Me.m_myVar
    6.   End Get
    7.   Set(ByVal Value As String)
    8.     Me.m_myVar = Value
    9.   End Set
    10. End Property
    11.  
    12. Private Sub Button1_Click(ByVal sender as System.Object, ByVal e As System.EventArgs)  Handles Button1.Click
    13.   Dim lv As ListViewItem = ListView1.SelectedItems(0)
    14.   Me.m_myVar = lv.SubItems(2).Text
    15.   Me.listItem = lv.SubItems(2).Text
    16.   Me.Close
    17. End Sub

    And for Form1 I have this:

    VB Code:
    1. Dim myForm As New Form2
    2. myForm.ShowDialogue()
    3. MessageBox.Show(myForm.listItem)

    on Form2 I get the correct text.
    on Form1 (which is loaded after Form2), I get a blank field.

    Any ideas?

    Cheers.
    Last edited by Cyber-Drugs; Jul 28th, 2005 at 09:46 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width