如何在WPF,C#中实现我自己的TextBox [英] How to implement my own TextBox in WPF, C#

查看:98
本文介绍了如何在WPF,C#中实现我自己的TextBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我正在尝试实现自己的文本框",例如C#,WPF中的控件.

我要实现以下功能:

1.从上至下显示编辑后的文本.

示例:

textbox.Text =这是显示文本的示例.";

会显示:

Hi!

I''m trying to implement my own "textbox" like control in C#, WPF.

I want to implement the following features:

1. display the edited text from top to bottom.

Example:

textbox.Text = "This is an example how the text should be displayed.";

would show:

T ahes sd 
iamo hbp.
snpwtoel
  l eu a
ieetxldy
sx htdie



2.必须能够显示彩色文本.没有图片,没有不同的字体,没有粗体,没有斜体.它应显示具有不同背景的列或在它们之间绘制虚线.

3.必须在边距上显示自定义文本(也要在顶部和底部显示).像行号和列号.

4.应该具有标准的文本编辑器功能:复制/粘贴/撤消


有人可以帮我一些建议吗?我应该从哪里开始? TextBoxBase?控制?有教程吗?有书吗?

谢谢!



2. has to be able to display colored text. No pictures, no different fonts, no bold, no italics. It should show the columns with different backgrounds or draw dotted lines between them.

3. Has to show custom text on the margins (top and bottom too). Like line numbers and column numbers.

4. Should have the standard text editor features: copy/paste/undo


Can anybody help me with some advice? Where do should I start from? TextBoxBase? Control? Any tutorials? Any books?

Thank you!

推荐答案

希望这些教程可以帮助您创建自定义控件.
custom-control-in-wpf.html [ ^ ]
HowToCreateACustomControl [ ^ ]
在wpf中的msdn自定义控件 [ WPF自定义控件-无痛苦 [
Hope these tutorials would help you to create custom control.
custom-control-in-wpf.html[^]
HowToCreateACustomControl[^]
msdn Custom control in wpf[^]
WPF Custom Controls - Without The Pain[^]


这篇关于如何在WPF,C#中实现我自己的TextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆