Return blank data to neighboring field?

We have a new software at work and I am trying to define certain parameters of the appearance. What I would like to do is if (s5) below returns the desired code, then the neighboring box would be empty. s5 = tlead1.text / the box I want emptied under the condition of s5 is labeled tweek.text

Here is the code that took me all day to figure out. I don't really have another day to work on it to try to get the right thing to happen.

When s5 = "0": tlead1.Value = "In Stock";

This works great! However, the value is lead time and when it is not "0" it needs to say Week(s) in the neighboring text box.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  	string s5 = tlead1.Text; 
	
	switch(s5) 
	{ 
		case "0": tlead1.Value = "In Stock";   		
			xunit2.Visible = false;
			//	xum2.Visible = false;
			xprice2.Visible = false;
			break;
		case null:
			xqty2.Visible = false;
			xunit2.Visible = false;
			//	xum2.Visible = false;
			xprice2.Visible = false;
			break;
		default: xqty2.Visible = true;
			xunit2.Visible = true;
			//	xum2.Visible = true;
			xprice2.Visible = true;
			break;
	}


Thanks in advance for the help!!
Last edited on
OK. I figured it out on my own.

I added under line 5 tweek.visible = false;
and added under line 16 tweek.visible = true;

This makes 'Week(s)' disappear if we have the item in stock and makes it appear if we do not.
Sorry for the confusion. This is actually C# not C++ for anyone that is looking for this answer.
Topic archived. No new replies allowed.