Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 C# 为 WP7 开发一个应用程序,用户在 10 秒内尽可能多地点击一个按钮,每次点击都会获得 2 分。在点击自身时,我希望总数的增量显示在文本框中。请帮忙!
XAML:-
<StackPanel> <Button Content="Tap Me" Click="Button_Click" /> <TextBox Name="MyTextBox" /> </StackPanel>
C#:-
private int count = 0; private void Button_Click(object sender, RoutedEventArgs e) { count++; this.MyTextBox.Text = count.ToString(); }
希望这可以帮助。