Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7535993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:27:10+00:00 2026-05-30T06:27:10+00:00

I want to have three textboxes(only one of them will be shown to input

  • 0

I want to have three textboxes(only one of them will be shown to input text) textbox to be enter text is chosen by buttons
I set opacity property of textbox 0.0 to hide set opacity to 1.0 to show.

In xaml page:

<StackPanel Grid.Row="0" Orientation="Horizontal">
            <Button x:Name="btnGood" HorizontalAlignment="Center" 
                        Content="Good" 
                        Click="Toggle_Click">
            </Button>
            <Button x:Name="btnBad" HorizontalAlignment="Center" 
                        Content="Bad"  
                        Click="Toggle_Click">
            </Button>
            <Button x:Name="btnDetail" HorizontalAlignment="Center" 
                        Content="Detail" 
                        Click="Toggle_Click">
            </Button>
        </StackPanel>
        <Grid Grid.Row="1">
            <TextBox x:Name="txtDetail" AcceptsReturn="True" 
                        TextWrapping="Wrap" />
            <TextBox x:Name="txtBad" AcceptsReturn="True" 
                        TextWrapping="Wrap" Opacity="0.0"/>
            <TextBox x:Name="txtGood" AcceptsReturn="True" 
                        TextWrapping="Wrap" Opacity="0.0"/>

        </Grid>

In Code:

private void Toggle_Click(object sender, RoutedEventArgs e)
    {
        Button btnSender = (Button)sender;
        string id = btnSender.Content.ToString();
        switch (id)
        {
            case "Good":
                {
                    txtDetail.Opacity = 0.0;
                    txtBad.Opacity = 0.0;
                    txtGood.Opacity = 1.0;
                }
                break;
            case "Bad":
                {
                    txtDetail.Opacity = 0.0;
                    txtGood.Opacity = 0.0;
                    txtBad.Opacity = 1.0;
                }
                break;
            case "Detail":
                {
                    txtBad.Opacity = 0.0;
                    txtGood.Opacity = 0.0;
                    txtDetail.Opacity = 1.0;
                }
                break;
            default:
                break;
        }
    }

The Problem is: when good button is clicked txtGood textbox is shown and can see typed characters.
But when either bad or detail button is clicked the texts are entered into txtGood and it is not shown a dull colored empty textbox only shown. But it should be entered into respective textboxes and it should be visible to user. How can be fixed this problem ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:27:11+00:00Added an answer on May 30, 2026 at 6:27 am

    Why don’t you use txtBad.Visibility = Visibility.Collapsed? It’s a better way to hide some content on a screen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one TextBox in my UserControl. Here I want enter only positive or
I have a string in a textbox and want only one of the words
I have three lists that I want to convert into one list. When I
I have three source files in a folder. I simply want to compile them
I have a form with three text boxes. I want to have a key
I want to create script to edit photos in galery. I have there textbox
a have three column layout and i want to have three divs inside the
I have three HTML objects and want to arrange Previous button at the left
I have three images that I want to cycle through when clicking on a
I have three problems: I want to create resizable shapes with box bounding... I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.