CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2001
    Location
    Karachi, Pakistan.
    Posts
    466

    ComboBoxes in a ListBox

    Hello All:

    I was just wondering if i can Add a ComboBoxes in a ListBox with Multiple rows and columns. I would like to add as many ComboBoxes as the number of rows in a listBox.

    Thanks...
    KMan
    use code-tags
    Rating a post is'nt injurious(0:


    http://izlooite.blogspot.com

  2. #2
    Join Date
    Aug 2006
    Posts
    69

    Re: ComboBoxes in a ListBox

    AFAIK, this is not possible. I have looked into doing something similar which uses not just text but also images in a column of a ListBox, but haven not found any way to easily do this. The only solution that I can conceive involves using a Panel as a fake ListBox and building a mock ListBox on the fly with placed Controls. It would be some work to accomplish, but I think doable.

    Anyone else know of any other solutions?

  3. #3
    Join Date
    Apr 2001
    Location
    Karachi, Pakistan.
    Posts
    466

    Re: ComboBoxes in a ListBox

    Quote Originally Posted by thelinuxduck
    AFAIK, this is not possible. I have looked into doing something similar which uses not just text but also images in a column of a ListBox, but haven not found any way to easily do this. The only solution that I can conceive involves using a Panel as a fake ListBox and building a mock ListBox on the fly with placed Controls. It would be some work to accomplish, but I think doable.

    Anyone else know of any other solutions?
    Thank you thelinuxduck... i appreciate your reply.

    Attached is an screen shot that i captured from VisualStudio.Net.

    I would like to have something similar to the attached screenshot.

    Actually, I am mapping tables and fields of one database(lets say DB1) to tables and feilds of another database(DB2).

    DB1 has static values, DB2 has runtime values, and the database could be anything and could contain any number of fields. So, I was thinking if can have somthing similar to this screenshot, then I may be able to load the fields on DB1 in column 1 and provide a ComboBox in Column2. Clearly, the ComboBox in Column2(of the attached screenshot) will hold the fields from DB2.

    Any ideas, workarounds, links, etc... will be highly appreciated.

    Thanks,
    Attached Images Attached Images
    Last edited by jusstujoo; August 16th, 2006 at 01:07 AM. Reason: Attached screenshot
    KMan
    use code-tags
    Rating a post is'nt injurious(0:


    http://izlooite.blogspot.com

  4. #4
    Join Date
    Aug 2006
    Posts
    69

    Re: ComboBoxes in a ListBox

    You might look into the User Control. It allows you to build a custom control out of all the provided controls, and then use it on a form just like any other control. You might be able to put a static label/text box for the static item in DB1, and then a combo box for the dynamic item in DB2. Then, just add as many of the new control as you need on the form.

    May be something to investigate.

  5. #5
    Join Date
    Apr 2001
    Location
    Karachi, Pakistan.
    Posts
    466

    Re: ComboBoxes in a ListBox

    Thank you thelinuxduck. I appreciate your replies.

    Actually, I found that DataGrid Control offers this task. It requires a bit coding in .Net 1.1, but its easiest to add combos in DataGrid in .Net 2.0.

    Well, I am still looking into the examples. One I found good is http://www.codeproject.com/cs/miscct...ridColumns.asp

    Do take a look at it, and If you can help me with your comments.

    Now, my question is, How would I know the version of my .Net. And from where do I get the .Net 2.0?

    Thanks
    KMan
    use code-tags
    Rating a post is'nt injurious(0:


    http://izlooite.blogspot.com

  6. #6
    Join Date
    Apr 2005
    Posts
    576

    Re: ComboBoxes in a ListBox

    The image you showed is a PropertyGrid, such a control exists in .Net 1.1 already (but you have to add it to the tool box though).

  7. #7
    Join Date
    Apr 2002
    Location
    Egypt
    Posts
    2,210

    Re: ComboBoxes in a ListBox

    Quote Originally Posted by jusstujoo
    Now, my question is, How would I know the version of my .Net.
    the easiest way is to open Administrative Tools
    check the existance of:Microsoft .NET Framework 1.1 Configuration
    Microsoft .NET Framework 2.0 Configuration


    Quote Originally Posted by jusstujoo
    And from where do I get the .Net 2.0?
    Get framework from
    Microsoft .NET Framework Version 2.0 Redistributable Package (x86)

    Also check visual studio express editions:
    http://msdn.microsoft.com/vstudio/express/
    Hesham A. Amin
    My blog , Articles


    <a rel=https://twitter.com/HeshamAmin" border="0" /> @HeshamAmin

  8. #8
    Join Date
    Apr 2001
    Location
    Karachi, Pakistan.
    Posts
    466

    Re: ComboBoxes in a ListBox

    Quote Originally Posted by klintan
    The image you showed is a PropertyGrid, such a control exists in .Net 1.1 already (but you have to add it to the tool box though).
    Thank you, can you tell me the name of control so that I may be able to add the control?

    Quote Originally Posted by hspc
    the easiest way is to open Administrative Tools
    check the existance of:Microsoft .NET Framework 1.1 Configuration
    Microsoft .NET Framework 2.0 Configuration



    Get framework from
    Microsoft .NET Framework Version 2.0 Redistributable Package (x86)

    Also check visual studio express editions:
    http://msdn.microsoft.com/vstudio/express/
    Thank you HSPC:
    I just downloaded and installed the .Net 2.0. But How am I supposed to tell my VisualStudio.Net 2003 to stop using 1.1 and Start using .Net 2.0?
    KMan
    use code-tags
    Rating a post is'nt injurious(0:


    http://izlooite.blogspot.com

  9. #9
    Join Date
    Apr 2002
    Location
    Egypt
    Posts
    2,210

    Re: ComboBoxes in a ListBox

    Quote Originally Posted by jusstujoo
    I just downloaded and installed the .Net 2.0. But How am I supposed to tell my VisualStudio.Net 2003 to stop using 1.1 and Start using .Net 2.0?
    AFAIK, VS 2003 does not support .NET 2.0, Only 1.0,1.1 but they can run side by side..
    You should upgrade to VS2005 or use the free express editions (I use them and they are good)
    Hesham A. Amin
    My blog , Articles


    <a rel=https://twitter.com/HeshamAmin" border="0" /> @HeshamAmin

  10. #10
    Join Date
    Apr 2001
    Location
    Karachi, Pakistan.
    Posts
    466

    Re: ComboBoxes in a ListBox

    Thank you HSPC. For you response. I am downloading the Setup. Lets see.
    KMan
    use code-tags
    Rating a post is'nt injurious(0:


    http://izlooite.blogspot.com

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

Featured