Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using vb.net language

I have a dropdownlist, which is filled by below pattern

"Smith,James" so first one is surname and second after "," is firstname

I have two textboxes for surname and firstname. Now I want to fill the textbox when dropdownlist is changed.

I mean when user changes the dropdownlist the selected text in dropdown will be filled in related textboxes.

so my result will be like this

surname.text = "Smith" firstname.text = "James"

Please use vb.net code for this

Thanks.

Best Regards, MS

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
302 views
Welcome To Ask or Share your Answers For Others

1 Answer

Something like that should work:

surname.text = dropdownlist.SelectedItem.ToString().Split(",")(0)
firstname.text = dropdownlist.SelectedItem.ToString().Split(",")(1)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...