/// <summary> /// 设置编码下拉列表框的值 /// </summary> private void SetEcodingVal() { Dictionary <int, string> encDic = FileUtils.GetBrieflyFileEncodingInfo(); Dictionary <object, string> encDic2 = new Dictionary <object, string>(); // 将int转为object foreach (KeyValuePair <int, string> kvp in encDic) { encDic2.Add(kvp.Key, kvp.Value); } // 设置下拉列表框的值 ControlsUtils.SetComboBoxItems(输入_编码_comB, encDic2); // 选定与文本框编写相同的项 输入_编码_comB.SelectedValue = Encoding.UTF8.CodePage; // 设置自动匹配 输入_编码_comB.AutoCompleteMode = AutoCompleteMode.Suggest; 输入_编码_comB.AutoCompleteSource = AutoCompleteSource.ListItems; }
/// <summary> /// 设置下拉列表框的值 /// </summary> private void setCodingSet() { Dictionary <int, string> encDic = FileUtils.GetBrieflyFileEncodingInfo(); Dictionary <object, string> encDic2 = new Dictionary <object, string>(); // 将int转为object foreach (KeyValuePair <int, string> kvp in encDic) { encDic2.Add(kvp.Key, kvp.Value); } // 设置下拉列表框的值 ControlsUtils.SetComboBoxItems(coding_set, encDic2); // 选定与文本框编写相同的项 coding_set.SelectedValue = textCoding.CodePage; // 设置自动匹配 this.coding_set.AutoCompleteMode = AutoCompleteMode.Suggest; this.coding_set.AutoCompleteSource = AutoCompleteSource.ListItems; }