Thanks for your answer. I use this code:
Code:
private void button3_Click(object sender, EventArgs e)
        {
            OpenFileDialog LoadModel = new OpenFileDialog();
            LoadModel.Title = "Import Model";
            LoadModel.InitialDirectory = @"C:\";
            LoadModel.Filter = "MDL (*.mdl)|*.mdl|Alle Dateien (*.*)|*.*";
            LoadModel.FilterIndex = 1;
            LoadModel.RestoreDirectory = true;
            if(LoadModel.ShowDialog() == DialogResult.OK)
            {
                ENTITY.ent_create(LoadModel.FileName, new Vector(100, 100, 0), obj);
                _items.Add(LoadModel.FileName);
                listBox1.DataSource = null;
                listBox1.DataSource = _items;
            }
        }



It is called by a button in my Form. I think that OpenFileDialog returns a string but I don't know how to control the string.
The code does work sometimes, but bigger models cause it to crash and this is not because I am out of memory.



Last edited by Timothy; 06/12/12 19:03.