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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Multi Column List box

Multi Column List box

Scheduled Pinned Locked Moved Visual Basic
3 Posts 3 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.
  • N Offline
    N Offline
    New_Coder
    wrote on last edited by
    #1

    Is there a way to make a combo box multidimensional. I am populating a combo box through code using from a table REPORT_CHOICE.AddItem !FIELD_NAME The table I am using has two columns FILED_NAME and TABLE_NAME Is there a way to make a combo box multidimensional to hold both columns and be able to extract both colums to two different variables after I make a selection on the drop down box or do I need to 1) reconect to the table 2) search for the "FIELD_NAME" value I selected in the drop down box 3) populate my second variable with the "TABLE_NAME" table value Thanks

    C R 2 Replies Last reply
    0
    • N New_Coder

      Is there a way to make a combo box multidimensional. I am populating a combo box through code using from a table REPORT_CHOICE.AddItem !FIELD_NAME The table I am using has two columns FILED_NAME and TABLE_NAME Is there a way to make a combo box multidimensional to hold both columns and be able to extract both colums to two different variables after I make a selection on the drop down box or do I need to 1) reconect to the table 2) search for the "FIELD_NAME" value I selected in the drop down box 3) populate my second variable with the "TABLE_NAME" table value Thanks

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

      No, there's no way to do that.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • N New_Coder

        Is there a way to make a combo box multidimensional. I am populating a combo box through code using from a table REPORT_CHOICE.AddItem !FIELD_NAME The table I am using has two columns FILED_NAME and TABLE_NAME Is there a way to make a combo box multidimensional to hold both columns and be able to extract both colums to two different variables after I make a selection on the drop down box or do I need to 1) reconect to the table 2) search for the "FIELD_NAME" value I selected in the drop down box 3) populate my second variable with the "TABLE_NAME" table value Thanks

        R Offline
        R Offline
        Rupesh Kumar Swami
        wrote on last edited by
        #3

        hi, try something like first of all make a structure this is the code for the structure. Private Structure ComboMultipleData Dim FILED_NAME As String Dim TABLE_NAME As String Public Sub New( ByVal FieldVal As String, ByVal TableVal As String) FILED_NAME = FieldVal TABLE_NAME = TableVal End Sub Public Overrides Function ToString() As String Return Me.FILED_NAM End Function End Structure And the code to put this in the combobox and translate it when the user selects an item from the list. Private Sub frmDemo_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load 'for the purposes of this demo I am hard coding the entries With REPORT_CHOICE .Items.Add(New ComboMultipleData( "FieldVal1", "Table 1")) .Items.Add(New ComboMultipleData( "FieldVal2", "Table 2")) .Items.Add(New ComboMultipleData( "FieldVal3", "Table 3")) End With End Sub Private Sub REPORT_CHOICE_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles REPORT_CHOICE.SelectedIndexChanged 'in this case simply put the data up into the available fields Dim acc As ComboMultipleData= CType(cboAccounts.SelectedItem, ComboMultipleData) txtFieldName.Text = acc.FILED_NAME txtTableName.Text = acc.TABLE_NAME End Sub hope this helps

        Rupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India) My Company

        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