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. .NET (Core and Framework)
  4. Rendering Forms Controls within rows of a listbox

Rendering Forms Controls within rows of a listbox

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpquestiondiscussion
4 Posts 2 Posters 1 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.
  • R Offline
    R Offline
    Ruth Ivimey Cook
    wrote on last edited by
    #1

    Hi, I am speccing an application that requires a listbox control whose rows contain other (output-only) controls; namely a static image, a drawn image (i.e. can't be in a file), a progress bar and some plain text. Something like: #pic# < Image > [---Bar-- ] Text All in one row, with different controls simultaneously visible in other rows. I know it is possible to OwnerDraw all this from scratch. Is it possible to build it up using existing other controls, esp. the progressbar control. Any thoughts? Ruth

    O 1 Reply Last reply
    0
    • R Ruth Ivimey Cook

      Hi, I am speccing an application that requires a listbox control whose rows contain other (output-only) controls; namely a static image, a drawn image (i.e. can't be in a file), a progress bar and some plain text. Something like: #pic# < Image > [---Bar-- ] Text All in one row, with different controls simultaneously visible in other rows. I know it is possible to OwnerDraw all this from scratch. Is it possible to build it up using existing other controls, esp. the progressbar control. Any thoughts? Ruth

      O Offline
      O Offline
      oykica
      wrote on last edited by
      #2

      Hi Ruth, You could use the DataGrid control and create custom a DataGridColumnStyle for you progress bar and other controls. This MSDN article has some introductory information and takes you through some sample code. I recommend that you read part 1 before moving onto part 2 so that you understand the architecture of the DataGrid. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/datagridcolumnstyle1.asp

      R 1 Reply Last reply
      0
      • O oykica

        Hi Ruth, You could use the DataGrid control and create custom a DataGridColumnStyle for you progress bar and other controls. This MSDN article has some introductory information and takes you through some sample code. I recommend that you read part 1 before moving onto part 2 so that you understand the architecture of the DataGrid. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/datagridcolumnstyle1.asp

        R Offline
        R Offline
        Ruth Ivimey Cook
        wrote on last edited by
        #3

        Thanks for the link: it was useful. Do you suggest the DataGrid because you know the ListBox cannott do what I want?

        O 1 Reply Last reply
        0
        • R Ruth Ivimey Cook

          Thanks for the link: it was useful. Do you suggest the DataGrid because you know the ListBox cannott do what I want?

          O Offline
          O Offline
          oykica
          wrote on last edited by
          #4

          I am glad that you found the link useful. I certainly found it to be an interesting article. I have seen the ListBox control customised but not to the extent that you require. The DataGrid control was built with extensibility in mind whereas the ListBox control was always meant to be a simple control for simple situations. Perhaps it is possible to do what you are asking with the ListBox control but I am not sure how you would go about it. I would personally stick with a method that is well documented and that is easier to find help for if you run into problems.

          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