我用了一个comboBox控件,其中我用了一个TextChanged事件。代码如下:
 private void comboBox1_TextChanged(object sender, EventArgs e)
        {
            this.comboBox1.Items.Clear();
            SqlConnection cn = new SqlConnection("server=.....;database=......;uid=....;pwd=....");
            cn.Open();
            SqlCommand cm = new SqlCommand("select name from center_info where name like '%" + this.comboBox1.Text + "%'", cn);
            SqlDataReader sdr = cm.ExecuteReader();
            while (sdr.Read())
            {
                this.comboBox1.Items.Add(sdr.GetValue(0));
            }
            cn.Close();
        }
当我在comboBox中输入文字的时候,显示是倒过来的,比如,我打字打的是“论坛”,显示在comboBox中却是“坛论”,输入的是“abcd”,显示的是“dcba”,也就是说,输完一个字符后,光标始终定位在comboBox文本框中最前面,导致输出的内容倒过来了,请高人请教这是什么原因?郁闷,有什么解决办法?