update from combobo to textbox
-
HI, i am trying to work with windows form.... Pardon me for asking such a basic question.... 1)i have a text box and a combo box and a button in windows form...... when i click on the button i want the item selected in my combobox to displayed in the text box......what is the code for this?? i tried the following code "txtBranch.Text = cmbBranch.SelectedIndex();" 2)similarly if i add a datagrid to this i want the data grid to display this item selected in the combobox......what is the code for this?? 3)if anybody can provide any link that will help me to get familiarise in windows controls that will be good.... thanking you j
-
HI, i am trying to work with windows form.... Pardon me for asking such a basic question.... 1)i have a text box and a combo box and a button in windows form...... when i click on the button i want the item selected in my combobox to displayed in the text box......what is the code for this?? i tried the following code "txtBranch.Text = cmbBranch.SelectedIndex();" 2)similarly if i add a datagrid to this i want the data grid to display this item selected in the combobox......what is the code for this?? 3)if anybody can provide any link that will help me to get familiarise in windows controls that will be good.... thanking you j
kabutar wrote:
i tried the following code "txtBranch.Text = cmbBranch.SelectedIndex();"
Well, that won't work. The reason is that the selected index is a number. Also, it's a property, so the brackets are wrong. You would have got error messages explaining this. Try txtBranch.Text = cmbBranch.Text
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
-
kabutar wrote:
i tried the following code "txtBranch.Text = cmbBranch.SelectedIndex();"
Well, that won't work. The reason is that the selected index is a number. Also, it's a property, so the brackets are wrong. You would have got error messages explaining this. Try txtBranch.Text = cmbBranch.Text
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )