【问题标题】:How to assign text to the rich textbox control when mouse pointer pointing on the image using wpf?当鼠标指针指向使用wpf的图像时,如何将文本分配给富文本框控件?
【发布时间】:2011-10-29 15:47:33
【问题描述】:

我有图片。当鼠标指针指向/在该图像上时,图像描述应该在富文本框中可见吗?怎么样?

请问,有人知道吗?请尽快回复我

提前致谢。

【问题讨论】:

    标签: wpf image controls richtextbox


    【解决方案1】:

    当属性 (IsMouseOver) 设置为 true 时,您可以将 Trigger 添加到设置 RichTextBox 内容的图像中。查看this link了解更多信息

    【讨论】:

      【解决方案2】:

      private void image1_MouseMove(object sender, MouseEventArgs e) { textBox1.Text = "神仙鱼1"; }

          private void image2_MouseMove(object sender, MouseEventArgs e)
          {
              textBox1.Text = "clownfish";
          }
      
          private void image3_MouseMove(object sender, MouseEventArgs e)
          {
              textBox1.Text = "exotic";
          }
      
          private void image4_MouseMove(object sender, MouseEventArgs e)
          {
              textBox1.Text = "seahorse";
          }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-08-23
        • 2014-08-23
        • 2018-05-16
        • 2013-04-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多