|
-
Jan 22nd, 2019, 11:35 AM
#1
Thread Starter
Junior Member
Combo Box contents into a text box field
Hi all
I have 3 combo boxes that users select data, i want to pass the selected data to a text box, as this text box then encodes to a bar code,
I can manually type in the text box and the bar code works, I just need to pass the data from the combo boxes to the text boxes.
Is this the correct way to do it or am i way of the mark.
Thanks in advance
Ant
-
Jan 22nd, 2019, 12:00 PM
#2
Re: Combo Box contents into a text box field
Do you want this value 'passed' only when there is a selection made in all 3 boxs?
-
Jan 22nd, 2019, 12:20 PM
#3
Thread Starter
Junior Member
Re: Combo Box contents into a text box field
yes or can be a button to pass the 3 selections many thanks
-
Jan 22nd, 2019, 12:36 PM
#4
Re: Combo Box contents into a text box field
There are many ways you could get there. This example assumes DropStyle of DropDown where the user can type a value, but will handle the selected dropdown text change also
Code:
Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.TextChanged,
ComboBox2.TextChanged,
ComboBox3.TextChanged
If Not String.IsNullOrEmpty(ComboBox1.Text) AndAlso
Not String.IsNullOrEmpty(ComboBox2.Text) AndAlso
Not String.IsNullOrEmpty(ComboBox3.Text) Then
TextBox1.Text = ComboBox1.Text & ComboBox2.Text & ComboBox3.Text
Else
TextBox1.Clear()
End If
End Sub
you could modify this into a button click easy enough
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|