|
■No5812 (長谷川 さん) に返信
> VB.NET2005でDataGridViewのヘッダー行はやはり改行は無理なのでしょうか?
ヘッダーの WrapMode はどうなっていますか?
そこが True 相当になっているなら、改行コードを含めるだけで表示されるはずですけれども。
Private dataGridView1 As DataGridView
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
dataGridView1 = New DataGridView()
dataGridView1.Dock = DockStyle.Fill
dataGridView1.AllowUserToAddRows = False
dataGridView1.RowCount = 2
dataGridView1.ColumnCount = 2
dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True
Controls.Add(dataGridView1)
dataGridView1.TopLeftHeaderCell.Value = "あああ" & vbNewLine & "いいい"
dataGridView1.Columns(0).HeaderCell.Value = "ううう" & vbNewLine & "えええ"
dataGridView1.Columns(1).HeaderCell.Value = "おおお" & vbNewLine & "かかか"
dataGridView1.Rows(0).HeaderCell.Value = "ききき" & vbNewLine & "くくく"
dataGridView1.Rows(1).HeaderCell.Value = "けけけ" & vbNewLine & "こここ"
dataGridView1(0, 0).Value = "0" & vbNewLine & "0"
dataGridView1(0, 1).Value = "0" & vbNewLine & "1"
dataGridView1(1, 0).Value = "1" & vbNewLine & "0"
dataGridView1(1, 1).Value = "1" & vbNewLine & "1"
dataGridView1.ColumnHeadersHeight = 50
dataGridView1.Rows(0).Height = 50
dataGridView1.Rows(1).Height = 50
dataGridView1.RowHeadersWidth = 90
dataGridView1.Columns(0).Width = 90
dataGridView1.Columns(1).Width = 90
End Sub
|