Results 1 to 15 of 15

Thread: VB.NET: Adding Items to ComboBox from previous form....[Resolved]

Threaded View

  1. #1

    Thread Starter
    Addicted Member toytoy's Avatar
    Join Date
    Jul 2004
    Posts
    230

    VB.NET: Adding Items to ComboBox from previous form....[Resolved]

    Say i have Form1 with comboBox1 and Form2 with comboBox2..

    When i click on Form1 button, Form2 will appear on top of Form1...

    My Code:
    Code:
    ' Form1 button 
     Private Sub btnOne_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOne.Click
            Dim form2 As New Form2
            form2.ShowDialog()
        End Sub
    How to add the items from Form2 's comboBox to Form1 's comboBox...

    My Code:
    Code:
    ' Form2 button 
      Private Sub btnTwo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTwo.Click
           Dim form1 As New Form1
           form1.comboBox1.Items.Add(Me.comboBox2.Text)
        End Sub
    These code will not have any effect on comboBox1 in Form1..

    Thanks
    Last edited by toytoy; Dec 3rd, 2004 at 07:43 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