关于文本更改事件 [英] regarding textchanged event
问题描述
嗨..
我已经定义了一种方法,可以将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屋!