2014-04-07 56 views
-2
private void InvoiceForm_Load(object sender, EventArgs e) 
{ 
    comboBox2.Focus(); 
    lstinv = invhnd.Get();// lstinv is inventry type list 
    comboBox2.DataSource = lstinv; 
    comboBox2.DisplayMember = "ItemName"; 
    comboBox2.ValueMember = "ItemPrice";   
} 
+2

你是什麼意思_not working_?任何異常或錯誤信息? Get()方法有什麼作用?一點點的解釋會有所幫助.. –

+0

我只是希望每當窗體打開組合框應該是焦點 – mohsin

+0

使用ComboBox.Select方法 – Pankaj

回答

2

您應該使用ComboBox.Select方法

+0

thnx其工作 – mohsin

0

嘗試設置tabindex屬性組合框零財產,但請記住,你將需要改變的其他tabIndex屬性控件的值爲0)