private void InitializeComponent() { var treeListColumn1 = new TreeListColumn("fldName", "Filename"); var treeListColumn2 = new TreeListColumn("fldTitle", "Title"); var treeListColumn3 = new TreeListColumn("fldEpisode", "Episode"); var treeListColumn4 = new TreeListColumn("fldLinesLeft", "Lines done"); btnOpen = new Button(); btnCancel = new Button(); tlvScripts = new TreeListView(); tlvScripts.BeginInit(); SuspendLayout(); btnOpen.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; btnOpen.DialogResult = DialogResult.OK; btnOpen.Enabled = false; btnOpen.Location = new Point(431, 257); btnOpen.Name = "btnOpen"; btnOpen.Size = new Size(75, 23); btnOpen.TabIndex = 1; btnOpen.Text = "Open"; btnOpen.UseVisualStyleBackColor = true; btnOpen.Click += btnOpen_Click; btnCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; btnCancel.DialogResult = DialogResult.Cancel; btnCancel.Location = new Point(350, 258); btnCancel.Name = "btnCancel"; btnCancel.Size = new Size(75, 23); btnCancel.TabIndex = 2; btnCancel.Text = "Cancel"; btnCancel.UseVisualStyleBackColor = true; btnCancel.Click += btnCancel_Click; tlvScripts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; treeListColumn1.AutoSize = true; treeListColumn1.AutoSizeMinSize = 0; treeListColumn1.Width = 50; treeListColumn2.AutoSize = true; treeListColumn2.AutoSizeMinSize = 0; treeListColumn2.Width = 50; treeListColumn3.AutoSizeMinSize = 0; treeListColumn3.HeaderFormat.TextAlignment = ContentAlignment.MiddleLeft; treeListColumn3.Width = 70; treeListColumn4.AutoSizeMinSize = 0; treeListColumn4.HeaderFormat.TextAlignment = ContentAlignment.MiddleLeft; treeListColumn4.Width = 70; tlvScripts.Columns.AddRange(new TreeListColumn[4] { treeListColumn1, treeListColumn2, treeListColumn3, treeListColumn4 }); tlvScripts.Cursor = Cursors.Arrow; tlvScripts.Images = null; tlvScripts.Location = new Point(10, 10); tlvScripts.Name = "tlvScripts"; tlvScripts.RowOptions.ShowHeader = false; // Ramme rundt tlvScripts.Size = new Size(600, 700); tlvScripts.TabIndex = 3; tlvScripts.Text = "Scripts"; tlvScripts.DoubleClick += tlvScripts_DoubleClick; tlvScripts.AfterSelect += tlvScripts_AfterSelect; tlvScripts.KeyPress += tlvScripts_KeyPress; AutoScaleDimensions = new SizeF(6f, 13f); AutoScaleMode = AutoScaleMode.Font; // FilÅpner ClientSize = new Size(640, 740); Controls.Add(tlvScripts); Controls.Add(btnCancel); Controls.Add(btnOpen); Name = "FileSelector"; Text = "Select Script"; tlvScripts.EndInit(); ResumeLayout(false); }