locked
vb multicolumn combobox RRS feed

  • 問題

  • I wish can have great understanding to evaluate a simple multicolumn combobox.

    example: combobox need id and name or more for display, but after select i just need id display and process in combobox only.

    Any suggention?

    2011年4月27日 3:39

所有回覆

  • Hi

    What is multicolumn combobox?

    you can only set the value and reference the value. No other thing.

    Have a perfect day.


    Call me ghost for short, Thanks
    To get the better anwser, it should be a better question.
    2011年4月29日 10:09
  • Thanks for your reply.

    My problem like this:

    In combobox I cant just show ID number,user difficult to refer what is that, so I need to display ID with the ID refer member,it can easy for user to understand.

    I wish combobox can show the ID and also member,but after select,combobox only return the selected ID for process.

    Please give some suggestion.

    2011年5月5日 1:29
  • 你好,

    這裡是中文論壇,請發到英文論壇:

    http://social.msdn.microsoft.com/Forums/en-US/category/visualbasic

    Best regards


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    2011年5月5日 7:47
  • 对不起,

    我只想解决问题,任何语文都可以。

    你有任何意见吗?

     

    2011年5月5日 8:39
  • Hi,

    I think you should be polite, the job of a modrator is that taking care of the forum.

    However, see this code:

        Dim items As New DataTable
        items.Columns.Add("id", Type.GetType("System.Int32"))
        items.Columns.Add("value", Type.GetType("System.String"))
        items.Rows.Add(1, "my")
        items.Rows.Add(2, "your")
        Me.ComboBox1.DataSource = items
        Me.ComboBox1.DisplayMember = "value"
        Me.ComboBox1.ValueMember = "id"
    
    Have a nice day.
    

    Call me ghost for short, Thanks
    To get the better anwser, it should be a better question.
    2011年5月5日 10:01
  • Sorry,I no offence,maybe there are mistake in my sentence.

    Thanks for your suggestion,after i try it only display the 'value',i hope can display 'id' and 'value' together,it is like combobox in access.

    Sorry again for my mistake.

    2011年5月6日 1:23
  • Hello, you may take a look at this developer article: http://www.codeproject.com/KB/cpp/multicolumncombo.aspx :)
    2011年7月2日 7:06
  • May I ask, your project is web Form or Win Form?
    大家一齊探討、學習和研究,謝謝!
    Microsoft MVP, Microsoft Community Star(TW & HK), MCT,
    MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD
    2011年7月18日 2:16
  • May I ask, your project is web Form or Win Form?

    I guess it's talking about WinForm, otherwise it would be DropDownList instead of ComboBox. :)

    2011年7月18日 3:33
  • HK Forum is also supporting ENGLISH!!!!!!!!!!!! NOT ONLY T.CHINESE!!!!!! NOT ONLY S.Chinese!!!!!

    大家一齊探討、學習和研究,謝謝!
    MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD,
    MCT, Microsoft Community Star(TW & HK),
    Microsoft MVP for VB.NET since 2003
    My MSMVP Blog

    2012年11月10日 18:19