xaml:

<Window x:Class="WpfApplication1.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window2" Height="345" Width="478">
<Grid>
<TextBox Height="23" HorizontalAlignment="Left" Margin="152,50,0,0" Name="textBox1" VerticalAlignment="Top" Width="158" Text="ABCDE" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="152,105,0,0" Name="textBox2" Text="{Binding Path=Text.[3],ElementName=textBox1,Mode=OneWay}" VerticalAlignment="Top" Width="158"/>
</Grid>
</Window>

cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Shapes; namespace WpfApplication1
{
/// <summary>
/// Window2.xaml 的交互逻辑
/// </summary>
public partial class Window2 : Window
{
public Window2()
{
InitializeComponent();
//this.textBox2.SetBinding(TextBox.TextProperty, new Binding("Text.Length") {Source = textBox1, Mode= BindingMode.OneWay });
this.textBox2.SetBinding(TextBox.TextProperty, new Binding("Text.[3]") { Source=textBox1,Mode= BindingMode.OneWay});
}
}
}

最新文章

  1. Java的Json解析包FastJson使用
  2. Objective-C 快速入门--基础(五)
  3. html中a标签做容器的问题
  4. java读取properties配置文件方法(一)
  5. Java Phaser
  6. openstack 实例迁移
  7. HDU 5810 Balls and Boxes (找规律)
  8. HDOJ(HDU) 2136 Largest prime factor(素数筛选)
  9. 复数类(C++练习一)
  10. 6_StopWatch
  11. [补档]暑假集训D3总结
  12. 02-移动端开发教程-CSS3新特性(中)
  13. 安装nodejs中遇到的问题
  14. Thymeleaf 3.0 专题
  15. 浅析HTTP代理原理--转
  16. 二十三、Spring框架的相关知识点总结
  17. sql 中有关时间的语句
  18. Jmeter接口测试(八)cookie设置
  19. Sublime Text自定义插入当前时间的插件
  20. Linq编译带来的诡异错误

热门文章

  1. A标签使用javascript:伪协议
  2. IIS错误日志:Failed to execute request because the App-Domain
  3. 解决java中对URL编码的问题
  4. How to setup ELM327 Bluetooth WiFi for Android software Torque
  5. CentOS6.5 64bit 运行Mono程序
  6. Flask-在浏览器中直接显示文本文件中的内容
  7. 添加iPhone设备的udid之后,重新生成开发证书(Development)
  8. 深入浅出ExtJS 第七章 弹出窗口
  9. 在sql-server上建立mysql链接库
  10. C# 操作 Excel 常见问题收集和整理(定期更新,欢迎交流)