【问题标题】:C#- Checking two fields of different forms in one applicationC#- 在一个应用程序中检查不同形式的两个字段
【发布时间】:2012-11-27 10:52:07
【问题描述】:

我的字段名称为

List<string> names = af.GetSignatureNames();

我在组合框中输入为

comboBox1.Items.Add(new combodata("Signature 1"));
comboBox1.Items.Add(new combodata("Signature 2"));
comboBox1.Items.Add(new combodata("Signature 3"));

并在函数中检索与

相同的内容
comboBox1.SelectedItem.ToString();//combobox value taken

问题是我在 pdf 文件中有表单 2 上的组合框和表单 1 上的字符串名称列表我想比较这两个字段,因为我有一些数据要添加到相应的签名字典中单击一个按钮.

【问题讨论】:

    标签: c# visual-studio-2010 c#-4.0 itextsharp


    【解决方案1】:

    在一个或另一个上使用公共静态变量以从另一种形式访问它。

    class myForm1
    {    
       public static List<string> myList;
    
       //code here
    }
    
    class myForm2
    {
       myForm1.myList //do something with it
    }
    

    【讨论】:

    • 类指定是不同的terey是部分类
    猜你喜欢
    • 1970-01-01
    • 2012-12-02
    • 1970-01-01
    • 1970-01-01
    • 2016-10-12
    • 2019-11-18
    • 2013-07-28
    • 1970-01-01
    • 2018-04-23
    相关资源
    最近更新 更多