This article describes the method of C# to bind Combobox. Share it for your reference. The specific implementation method is as follows:
public class StaticVariable { public Dictionary<string, string> tabTypeArray; public Dictionary<string, string> transTimeArray; public Dictionary<string, string> fileDealTypeArray; public StaticVariable() { tabTypeArray = new Dictionary<string, string>(); ("1", "Fixed length type"); ("2", "Non-fixed length type"); ("3", "Manual Compression File"); ("4", "dutyForm"); ("10", "Bulletin"); ("0", "Unknown Type"); transTimeArray = new Dictionary<string, string>(); ("-1", "Real-time processing"); ("0", "Not dealt with"); fileDealTypeArray = new Dictionary<string, string>(); ("0", "Normal File"); ("1", "Incremental File"); } } void BinderCombobox() { staticVariable = new (); foreach (string key in ) { (new DictionaryEntry(key, [key])); } foreach (string key in ) { (new DictionaryEntry(key, [key])); } foreach (string key in ) { (new DictionaryEntry(key, [key])); } = "value"; = "key"; = "value"; = "key"; = "value"; = "key"; if ( > 0) = 0; if ( > 0) = 0; if ( > 0) = 0; }
I hope this article will be helpful to everyone's C# programming.