Results 1 to 4 of 4

Thread: [RESOLVED] combobox selected item text

  1. #1

    Thread Starter
    Hyperactive Member snakeman's Avatar
    Join Date
    Aug 2006
    Posts
    351

    Resolved [RESOLVED] combobox selected item text

    hey guys
    i set the datasource property of my combobox to datatable
    and ofcourse the displaymember and value member

    and now i want to take the text in the selected item aand save it into variable?

    i tried this

    Code:
    dim x as string=nothing
    x=combobox1.selecteditem.tostring
    but it is returned datarowview
    so what i must do??

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: combobox selected item text

    Dim x As String = ComboBox1.Text
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  3. #3

    Thread Starter
    Hyperactive Member snakeman's Avatar
    Join Date
    Aug 2006
    Posts
    351

    Re: combobox selected item text

    lol
    thank you
    i didn't notice that
    i feel like newbie
    lol
    thanks again

  4. #4
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: [RESOLVED] combobox selected item text

    No prob, glad we could help.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width