Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. update from combobo to textbox

update from combobo to textbox

Scheduled Pinned Locked Moved C#
questioncsshelpannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kabutar
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • K kabutar

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      K 1 Reply Last reply
      0
      • C Christian Graus

        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 )

        K Offline
        K Offline
        kabutar
        wrote on last edited by
        #3

        Hi, ThankYou it worked.......Thanks a lot...... i tried google to find links that will help me to learn windows forms myself... but i cannot find anything...... if its not much trouble can you get me a link ..... thanks again j

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups