TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Israel
693
1.3k
219.4k
Do not allow twice values into a textbox
Aug 28 2015 8:52 PM
Hi!
I have one combobox with a textbox.
Inside of my combobox I have three items (Morning, afternoon, goodnight). Then each selection is displayed into the textBox.
What I need to do?
When I select "morning" for example I would like that even I selected the second way its not should appear twice into the textbox (only once). Its allow to appear again ONLY when the textbox its clean it.
My code:
private void cbxChoice_SelectedIndexChanged(object sender, EventArgs e)
{
switch (cbxChoice.SelectedIndex)
{
case 0:
//Morning
textDisplay.Text += "\n" + Environment.NewLine + cbxChoice.Text + Environment.NewLine + ",";
textDisplay.clear();
break;
case 1:
//Afternoon
textDisplay.Text += "\n" + Environment.NewLine + cbxChoice.Text + Environment.NewLine + ",";
textDisplay.clear();
break;
case 2:
//Night
textDisplay.Text += "\n" + Environment.NewLine + cbxChoice.Text + Environment.NewLine + ",";
textDisplay.clear();
break;
Reply
Answers (
12
)
Binding large amount of data in dropdownlist very slow?
connection object