Question

I want to click on a button and make a text block and another button appear. I managed to make the text block appear. How do I make the button appear. I can't seem to find a function that does so. Also, does it need to be a different private void statement. So far I have:

private void one_Click(object sender, RoutedEventArgs e)
{
    oneBlock.Text = "one";
}

private void one_Click(object sender, RoutedEventArgs e)
{
    one_Trans.ClickMode = "two";
}
Was it helpful?

Solution

You can do something like this:

private void button1_Click(object sender, RoutedEventArgs e)
{
    button2.Visibility = Visibility.Visible;
}

XAML:

<Button x:Name="button2" Content="Button" Visibility="Collapsed"/>

More here: http://msdn.microsoft.com/en-us/library/system.windows.visibility(v=vs.95).aspx

OTHER TIPS

use

protected void button1_Click(object sender, EventArgs e)
{
    button2.Visible=true;
}

on the click event of button1

Put everything into the same event

private void one_Click(object sender, RoutedEventArgs e)
{
   oneBlock.Text = "one";
   one_Trans.ClickMode = "two";
   button1.Visible = true;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top