/**********************************************/
/*★ ListBox と TextBox を並べる 前田 稔 ★*/
/**********************************************/
using System;
using System.Drawing;
using System.Windows.Forms;
public class MyForm : Form
{
private SplitContainer splitContainer1;
private ListBox listBox1;
private TextBox textBox1;
public MyForm()
{
InitializeComponent();
Load += new System.EventHandler(MyForm_Load);
}
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.listBox1 = new System.Windows.Forms.ListBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.listBox1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.textBox1);
this.splitContainer1.Size = new System.Drawing.Size(638, 245);
this.splitContainer1.SplitterDistance = 364;
this.splitContainer1.TabIndex = 0;
//
// listBox1
//
this.listBox1.BackColor = System.Drawing.SystemColors.ControlDark;
this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 18;
this.listBox1.Location = new System.Drawing.Point(0, 0);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(364, 238);
this.listBox1.TabIndex = 0;
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Location = new System.Drawing.Point(0, 0);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(270, 245);
this.textBox1.TabIndex = 0;
//
// MyForm
//
this.ClientSize = new System.Drawing.Size(638, 245);
this.Controls.Add(this.splitContainer1);
this.Name = "MyForm";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
private void MyForm_Load(object sender, System.EventArgs e)
{
listBox1.Items.Add("0123456789");
listBox1.Items.Add("abcdegfg");
listBox1.Items.Add("HIJKLMN");
textBox1.Text = "Text Box\r\n0123456\r\nTestMessage\r\nMaedaMinoru";
}
}
class form01
{
public static void Main()
{
MyForm mf = new MyForm();
Application.Run(mf);
}
}
|