locked
Listview RRS feed

  • Question

  • hi all ,

                         i'm veronica,  and i need something to be clarified, well,  i know we can access different controls in the listview  [i meant we can have textbox, dropdown, progress bar......], so can anyone of you help me in adding such controls to my listview...

    please someone help me with this...

     

    Thanks&regards

    veronica

     

    Saturday, January 15, 2011 4:46 AM

Answers

  • Welcome to MSDN Forums.

    Do you need something like:

    using System.Drawing;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
      public class Form1 : Form
      {
        ListView lv = new ListView();
        ComboBox cb = new ComboBox();
        Button b = new Button();
        ProgressBar pb = new ProgressBar();
        public Form1()
        {
          lv.Dock = DockStyle.Fill;
          this.Controls.Add(lv);
          b.Location = new Point(cb.Right + 1, b.Location.Y);
          pb.Location = new Point(b.Right + 1, pb.Location.Y);
          lv.Controls.AddRange(new Control[] { cb, b, pb });
        }
      }
    }
    
    
    Thanks.


    LEARN HOW TO USE WINDOWS API DURING A QUICK, SIMPLE AND PRACTICAL HOW TO:
    How To: Changing TextBox blinking caret using Windows API
    • Proposed as answer by Paul Zhou Wednesday, January 19, 2011 8:33 AM
    • Marked as answer by Paul Zhou Friday, January 21, 2011 1:50 AM
    Saturday, January 15, 2011 11:46 AM

All replies

  • There are no controls set to a listview, but likewise Windows Explorer (some call it My Computer) in your OS you can set the view.

    http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.view.aspx


    Success
    Cor
    Saturday, January 15, 2011 11:23 AM
  • Welcome to MSDN Forums.

    Do you need something like:

    using System.Drawing;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
      public class Form1 : Form
      {
        ListView lv = new ListView();
        ComboBox cb = new ComboBox();
        Button b = new Button();
        ProgressBar pb = new ProgressBar();
        public Form1()
        {
          lv.Dock = DockStyle.Fill;
          this.Controls.Add(lv);
          b.Location = new Point(cb.Right + 1, b.Location.Y);
          pb.Location = new Point(b.Right + 1, pb.Location.Y);
          lv.Controls.AddRange(new Control[] { cb, b, pb });
        }
      }
    }
    
    
    Thanks.


    LEARN HOW TO USE WINDOWS API DURING A QUICK, SIMPLE AND PRACTICAL HOW TO:
    How To: Changing TextBox blinking caret using Windows API
    • Proposed as answer by Paul Zhou Wednesday, January 19, 2011 8:33 AM
    • Marked as answer by Paul Zhou Friday, January 21, 2011 1:50 AM
    Saturday, January 15, 2011 11:46 AM
  • hi all ,

                         i'm veronica,  and i need something to be clarified, well,  i know we can access different controls in the listview  [i meant we can have textbox, dropdown, progress bar......], so can anyone of you help me in adding such controls to my listview...

    please someone help me with this...

     

    Thanks&regards

    veronica

     

    I thik you should go for WPF. 

    this is not possible in windows form


    Regards Kumar Gaurav.
    Saturday, January 15, 2011 1:00 PM