private void MainForm_Load(object sender, EventArgs e) { this.KeyPreview = true; tilesListView.MultiSelect = false; textBox1.Width = tilesListView.Width - textBox1.Location.X; comboBox1.Width = tilesListView.Width - comboBox1.Location.X; MapPanel = mapPanel1; mapPanel1.Map = new Map(); mapPanel1.ActiveTool = _tools[drawToolButton]; mapPanel1.Map.Layers.Add(new Layer() { Name = "Base", Order = 0 }); mapPanel1.Krpyton.Lights = mapPanel1.Map.Lights; // mapPanel1.Krpyton.Hulls = mapPanel1.Map.Shadows; mapPanel1.ActiveLayer = mapPanel1.Map.Layers[0]; UndoService.Current[mapPanel1.Map].UndoStackChanged += new EventHandler(MainForm_UndoStackChanged); UndoService.Current[mapPanel1.Map].RedoStackChanged += new EventHandler(MainForm_RedoStackChanged); var directory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Objects"); TileRepository.Load(directory); foreach (var category in Directory.GetDirectories(directory)) { this.comboBox1.Items.Add(Path.GetFileNameWithoutExtension(category)); } }