帮助使用TextBlock [英] Help with TextBlock
问题描述
您好,我是WPF格式的入门者,我不知道如何在文本块中使用点击次数计数
Hi, i am a begginer on WPF format and i dont know how to use clicker count with text block
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApp1
{
/// <summary>
/// Lógica de interacción para MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
static int Clicks;
static string lord = Clicks.ToString();
private void Button_Click(object sender, RoutedEventArgs e)
{
++Clicks;
}
private void Text(object sender, DependencyPropertyChangedEventArgs e)
{
TextBlock textBlock = new TextBlock();
textBlock.Text = "click"+ lord;
MessageBox.Show(lord); }
}
}
我有一个按钮,当您单击时应显示"click". + Lord(主=按钮的点击次数),但请勿执行任何操作:(
i have a button that when u click should show "click" + Lord (lord =count of click on the button ) but dont do anything :(
推荐答案
PachiMc,
Hi PachiMc,
我注意到该问题与WPF有关.该论坛重点讨论Visio 2010的一般讨论,而不是Visual Studio.
I notice that the issue is related to the WPF. This forum focuses on the general discussion for Visio 2010 instead of Visual Studio.
为了更好地回答您的问题,我将该主题移到WPF论坛以获取更多帮助:
To better answer your question, I would move the thread to WPF forum for more help:
https://social.msdn.microsoft.com/Forums/vstudio /en-US/home?forum = wpf
这篇关于帮助使用TextBlock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!