如何在C#(WPF)中调用另一个事件中的一个事件 [英] How to call one event inside another event in C# (WPF)

查看:82
本文介绍了如何在C#(WPF)中调用另一个事件中的一个事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有两个活动:





1. private void gvWorkOrderDescription_BeginningEdit(object sender,Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs e)



2. private void gvWorkOrderDescription_CellEditEnded(object sender,Telerik.Windows.Controls。 GridViewCellEditEndedEventArgs e)



传递给wpf。



所以现在我必须检查一下单元格应该只接受数字和小数点,所以我使用另一个事件作为

private void TextBox_PreviewTextInput(object sender,TextCompositionEventArgs e)。





如果在编辑单元格(开始或结束)时必须传递TextBox_PreviewTextInput我该怎么做?



可以请任何人为我提供解决方案在C#(wpf)?

Hi,

I have two event as :


1. private void gvWorkOrderDescription_BeginningEdit(object sender, Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs e)

2. private void gvWorkOrderDescription_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)

which am passing in wpf.

so now i will have to check that the cell should only accept numeric and decimal points so am using another event as
private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e) .


If have to pass the TextBox_PreviewTextInput when the cell edited(begin or end) how do i do?

Can please anyone provide me a solution in C#(wpf)?

推荐答案

试试这个



try this

private void txtbox1_DoubleClick(object sender, EventArgs e)
{
    button1_Click(sender, e);
}

private void button1_Click(object sender, EventArgs e)
{
    MessageBox.Show(txtbox1.Text);
}


试试这个

try this
private void gvWorkOrderDescription_BeginningEdit(object sender, Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs e)
{
   gvWorkOrderDescription_CellEditEnded(object sender, e);
}


这篇关于如何在C#(WPF)中调用另一个事件中的一个事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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