小编use*_*984的帖子

C#new表单返回值不被Mainform识别

我通过Toolstrip打开另一个表单,输入Mainform中需要的用户名(并在Mainform中声明为String)

主体代码:

private void toolStripButton6_Click(object sender, EventArgs e)
    {
        using (Form frm = new Form3())
        {
            frm.FormBorderStyle = FormBorderStyle.FixedDialog;
            frm.StartPosition = FormStartPosition.CenterParent;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Username = frm.ReturnValue1;
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

Form3代码:

    public string ReturnValue1 { 
        get
        {
            return textBox1.Text;
        }
    } 
    private void button1_Click(object sender, EventArgs e)
    {
        this.Close();
    }
Run Code Online (Sandbox Code Playgroud)

C#告诉我没有frm.ReturnValue1 :(

.net c# forms variables toolstrip

0
推荐指数
1
解决办法
192
查看次数

C#与Linq加入3个名单

我想加入3个具有以下格式的列表:

List1:
  CountryID | CountryData     | regionUID
  ===================================
         12 | Has good gras   | 4567
         12 | nice weather    | 6789
         16 | stormy weather  | 1234

List2:
  CountryID | CountryName
  =======================
         12 | green hill
         16 | stormy mountain

List3:
  regionUID | regionName
  =======================
       4567 | above 1000feet
       6789 | on the ground
       1234 | on the hill
Run Code Online (Sandbox Code Playgroud)

输出应如下所示:

CountryName      | CountryData      | regionName
==============================================
 green hill      | Has good gras    | above 1000feet
 green hill      | nice weather …
Run Code Online (Sandbox Code Playgroud)

c# linq merge join list

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×2

.net ×1

forms ×1

join ×1

linq ×1

list ×1

merge ×1

toolstrip ×1

variables ×1