答案 0 :(得分:0)
制作+和 - 按钮以及带有绿色背景的标签。
点击加号或减号调整标签上的标签和文字的高度
private void plusButton_Click(object sender, RoutedEventArgs e)
{
if(percentLength.Height < 100)
percentLength.Height = percentLength.Height + 10;
}
private void minusButton_Click(object sender, RoutedEventArgs e)
{
if (percentLength.Height > 0)
percentLength.Height = percentLength.Height - 10;
}
protected void percentLength_HeightChanged(object sender, EventArgs e)
{
percentLength.Content = percentLength.Height + "%";
}