Пример #1
0
        //thay đổi từ điển
        private void btnSwap_Click(object sender, EventArgs e)
        {
            if (newDic is DictEV)
            {
                newDic = new DictVE();
                newDic.load();
                var arrayOfAllKeys = newDic.Dic.Keys.ToArray();
                var source         = new AutoCompleteStringCollection();
                source.AddRange(arrayOfAllKeys);
                txtSearch.AutoCompleteCustomSource = source;


                btnSwap.Text = "V-E";

                // add từ vào thư viện auto complete text
                return;
            }

            if (newDic is DictVE)
            {
                newDic = new DictEV();
                newDic.load();
                var arrayOfAllKeys = newDic.Dic.Keys.ToArray();
                var source         = new AutoCompleteStringCollection();
                source.AddRange(arrayOfAllKeys);
                txtSearch.AutoCompleteCustomSource = source;

                btnSwap.Text = "E-V";

                return;
            }
        }
Пример #2
0
        public Form1(int mode)
        {
            InitializeComponent();
            newDic.load();
            // add từ vào thư viện auto complete text
            var arrayOfAllKeys = newDic.Dic.Keys.ToArray();
            var source         = new AutoCompleteStringCollection();

            source.AddRange(arrayOfAllKeys);
            txtSearch.AutoCompleteCustomSource = source;
            //foreach (string key in arrayOfAllKeys)
            //{
            //    txtSearch.AutoCompleteCustomSource.Add(key);
            //}
            _mode = mode;
        }