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. C#
  4. 3rd party list box?

3rd party list box?

Scheduled Pinned Locked Moved C#
csharpdatabasehelptutorialquestion
6 Posts 4 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.
  • H Offline
    H Offline
    Harvey Saayman
    wrote on last edited by
    #1

    Hey guys i need my listBox items to be editable in the listBox itself. For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list. It seems the normal System.Windows.Forms.ListBox cant do it like that... unless im missing something? are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome Thanks

    Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

    D K L 3 Replies Last reply
    0
    • H Harvey Saayman

      Hey guys i need my listBox items to be editable in the listBox itself. For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list. It seems the normal System.Windows.Forms.ListBox cant do it like that... unless im missing something? are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome Thanks

      Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      There's a few in articles[^] on here Harvey. I think the standard way of doing this it to get overlay a textbox on the field that needs editing and remove it on enter or lost focus (obviously saving the data first). It is possible to embed controls in the list view (again a few articles) but that can be pretty memory intensive in a large list.

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Expect everything to be hard and then enjoy the things that come easy. (code-frog)

      H 1 Reply Last reply
      0
      • D DaveyM69

        There's a few in articles[^] on here Harvey. I think the standard way of doing this it to get overlay a textbox on the field that needs editing and remove it on enter or lost focus (obviously saving the data first). It is possible to embed controls in the list view (again a few articles) but that can be pretty memory intensive in a large list.

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Expect everything to be hard and then enjoy the things that come easy. (code-frog)

        H Offline
        H Offline
        Harvey Saayman
        wrote on last edited by
        #3

        Thanks dave I'll have a look :)

        Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

        1 Reply Last reply
        0
        • H Harvey Saayman

          Hey guys i need my listBox items to be editable in the listBox itself. For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list. It seems the normal System.Windows.Forms.ListBox cant do it like that... unless im missing something? are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome Thanks

          Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

          K Offline
          K Offline
          Kjetil Svendsen
          wrote on last edited by
          #4

          Hi Have you tried listview. No databinding, but otherwise perfect Kjetil

          H 1 Reply Last reply
          0
          • K Kjetil Svendsen

            Hi Have you tried listview. No databinding, but otherwise perfect Kjetil

            H Offline
            H Offline
            Harvey Saayman
            wrote on last edited by
            #5

            Hey Kjetil i found this[^] and it seems like its going to do what i need it to Thanks for replying though

            Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

            1 Reply Last reply
            0
            • H Harvey Saayman

              Hey guys i need my listBox items to be editable in the listBox itself. For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list. It seems the normal System.Windows.Forms.ListBox cant do it like that... unless im missing something? are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome Thanks

              Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

              L Offline
              L Offline
              Lutoslaw
              wrote on last edited by
              #6

              You can switch to ListView and set .View = View.List; Then use ListView's label editing feature.

              private void button2_Click(object sender, EventArgs e)
              {
              var item = listView1.Items.Add("");
              listView1.LabelEdit = true;
              item.BeginEdit();
              }
              private void listView1_AfterLabelEdit(object sender, LabelEditEventArgs e)
              {
              listView1.LabelEdit = false;
              }

              Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.

              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