如何在C#(WPF)中调用另一个事件中的一个事件 [英] How to call one event inside another event in 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屋!