Can I ask you how can I automatically fill my TextBox when I choose an unbound item in ComboBox. For example, I choose "January" in my First ComboBox, then "09" in 2nd ComboBox and "1993" for 3rd. Then it will Show "January 09, 1993" in my TextBox.

Recommended Answers

All 3 Replies

Member Avatar for Rahul47

It should be something like this:

TextBox.text=FirstComboBox.SelectedItem + SecondComboBox.selectedItem + ThirdComboBox.SelectedItem

Check for SelectedItem option in properties of ComboBox. Cannot give you snapshot right now as I dont have Visual studios installed.

Just remember to put spaces between them. But I have to ask, why not just use a datetimepicker? That way you don't have to check for invalid dates like April 31 and the user can pick a date with one control instead of three.

Member Avatar for Rahul47

Yep you should use datetimepicker as advised by Reverend Jim. orever Datetimepicker will allow a nice look rather than combo nasty and you wont have to pickup month,date seperately. And Less coding.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.