Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I WANT TO If the product check box is checked, I want the textbox value to be added automatically from the contents.
If not, let the checkbox open and select one of the products (trousers, shoes, shirt, tshirt, etc.).

For example

SELECT PRODUCT COUNTS IS CHECKED: trousers, shoes, shirt, tshirt ----> textbox count:2

SELECT PRODUCT COUNTS IS NOT CHECKED:open the checkbox list of desired products.
check the desired product.


I WANT TO ıf checkbox checks, textbox look. If not textbox not look

What I have tried:

<Grid>
     <CheckBox x:Name="checkBox" Unchecked="CheckBox_Checked_1" Checked="CheckBox_Checked_1" Content="SELECT PRODUCTS COUNT" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="117,62,0,0"/>
     <TextBox x:Name="textBox" Visibility="Visible" HorizontalAlignment="Left" Height="15" TextWrapping="Wrap" Text="2" VerticalAlignment="Top" Width="31" Margin="301,62,0,0"/>
 </Grid>
Posted
Updated 25-Aug-19 11:18am
v2

1 solution

You need another "event" in there; like a (submit) button click that checks the check box's checked prop before doing whatever.
 
Share this answer
 
Comments
Member 14169626 25-Aug-19 17:17pm    
private void CheckBox_Checked_1(object sender, RoutedEventArgs e)
{
CheckBox check = sender as CheckBox;
textBox.Text = Visibility.Visible.ToString(); // this line is dont run.

}

I dont done visibility visible

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900