Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27351

VS 2010 ComboBox Selected Item

$
0
0
Hello, any ideas how to make, when you select item from combobox (where is displyed Name and Lastname), that for example Lastname also displays to Texbox. So when you slelected item from combobox, in combobox would be displayed Name and Lastname, and in Texbox would be displayed Lastname from that selected item.

Realy thank you for your help... :bigyello:


Code:

Public Class Form2
    Public Comb As New DataClasses1DataContext

    Private Sub Table1BindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Validate()
        Me.Table1BindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DataSet1)

    End Sub

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DataSet1.Table1' table. You can move, or remove it, as needed.
        Me.Table1TableAdapter.Fill(Me.DataSet1.Table1)

        For Each Comb1 In Comb.Table1s
            ComboBox1.Items.Add(Comb1.Name & "," & Comb1.Lastname)
        Next
    End Sub
End Class


Viewing all articles
Browse latest Browse all 27351

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>