gpt4 book ai didi

c# - 在内部函数中调用方法 c#

转载 作者:太空宇宙 更新时间:2023-11-03 12:05:24 25 4
gpt4 key购买 nike

<分区>

我想将字符串值从函数传递到内部函数。

private void datagrid_customer_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
for (int i = 0; i < datagrid_customer.Items.Count; i++)
{
if (Convert.ToString((datagrid_customer.SelectedCells[3].Column.GetCellContent(datagrid_customer.SelectedItem) as TextBlock).Text) == Convert.ToString((datagrid_customer.SelectedCells[1].Column.GetCellContent(datagrid_customer.Items[i]) as TextBlock).Text))
{
...
string a = (b + c + d).ToString();
}
}

我想将a传递给另一个函数

datagrid_customer.SelectAll();

for (int i = 0; i < datagrid_customer.Items.Count; i++)
{
if (Convert.ToString((datagrid_customer.SelectedCells[43].Column.GetCellContent(datagrid_customer.Items[i]) as TextBlock).Text) == "0")
{
...
txt_f1.Text = a ;
}
}

我需要 txt_f1.text = a 但我无权使用 a

我该怎么办?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com