[英]C#- Checking two fields of different forms in one application
我有字段名稱
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
問題是我在表單 2 上有組合框,在 pdf 文件中的表單 1 上有字符串名稱列表我想比較這兩個字段,因為我有一些數據要通過單擊按鈕添加到相應的簽名字典中。
在一個或另一個上使用公共靜態變量以從另一種形式訪問它。
class myForm1
{
public static List<string> myList;
//code here
}
class myForm2
{
myForm1.myList //do something with it
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.