12
Answers

Do not allow twice values into a textbox

Israel

Israel

9y
626
1
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;
 
Answers (12)
0
Akhil Garg
NA 3.1k 440.9k 10y
You have window update issue. check this link.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/afeabac0-86d7-4ef1-a630-75c9e5f73663/cant-install-microsoft-framework-4-error-code-0xc8000222?forum=netfxsetup
0
khushboo modi
NA 12 2.3k 10y

Attachment log.zip

My Firwall is already off.
here i m shairing my log file, as well as the screenshort of the error screen:



0
Akhil Garg
NA 3.1k 440.9k 10y
You just check log file or share it. 


You can turn off your firewall and check .