关于文本更改事件 [英] regarding textchanged event

查看:69
本文介绍了关于文本更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..
我已经定义了一种方法,可以将richtextbox作为tabcontol的第一个控件. 但是我需要处理它的textchanged事件..
是否可以手动定义事件?如果是,那么如何使用.??

谢谢

Hi..
i have defined a method to get the richtextbox as a very first control of tabcontol..
but i need to work on its textchanged event..
is it possible to define an event manually? if yes then how it can be used.??

Thanks

推荐答案

RichTextBox rtb = new RichTextBox();
rtb.TextChanged += new EventHandler(rtb_TextChanged);









private void rtb_TextChanged(object sender, EventArgs e)
{
  // process the text changed event 
}



编辑

好吧,不知道我会尝试回答哪种RichTextBox.
假设您已经从后面的代码创建了richtextbox对象,其名称为rtb

如果键入rtb和点,则可以找到它的方法属性和事件,找到TextChanged并按Enter.
您所做的,请按+标记和=键,然后按两次Tab键.它将为您生成事件.

希望对您有所帮助.



EDIT

Ok, without knowing what kind of richtextbox i''ll try to answer.
Assume you have created object of richtextbox from code behind and its name is rtb

if you type rtb and dot you can find the methods properties and events of it, find TextChanged and hit enter.
ones you done that press + mark and = key and press tab key twice. it will generate event for you.

hope this helps.


这篇关于关于文本更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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