none
listbox greyed and controls locked RRS feed

  • Question

  • using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    
    namespace radar
    {
        public partial class Form2 : Form
        {
            public string ln;
            public string fname;
            public int i;
    
            public Form2()
            {
                InitializeComponent();
                listBox1.Visible = false;
            }
    
            private void Form2_Load(object sender, EventArgs e)
            {
                doit();
            }
    
            private void doit()
            {
                string line;
                var file = new System.IO.StreamReader("cyclehistory.txt");
                listBox1.Visible = true;
                while ((line = file.ReadLine()) != null)
                {
                    listBox1.Items.Add(line);
                }
                file.Close();
            }
        }
    }
    

    I have a very simple listbox which just reads and displays a text file.  Problem is, the box appears "greyed out" and the horizontal scrollbar is "locked".  Does anyone know what's going on????

    David Jaswaye

    jazzfoftware@nycap.rr.com

    Wednesday, February 12, 2014 1:49 AM

Answers