作成日: 2024/01/31 最終更新日: 2024/01/31
文書種別
使用方法
詳細
GcTextBoxCellのWrapModeプロパティにて、文字列の折り返し方法を指定(単語単位または文字単位)することができます。
[Visual Basic]
[C#]
[Visual Basic]
Imports GrapeCity.Win.MultiRow
Imports GrapeCity.Win.MultiRow.InputMan
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' 単語単位で折り返し
Dim gctcww As New GcTextBoxCell()
gctcww.WrapMode = GrapeCity.Win.Editors.WrapMode.WordWrap
gctcww.Style.Multiline = MultiRowTriState.True
' 文字単位で折り返し
Dim gctccw As New GcTextBoxCell()
gctccw.WrapMode = GrapeCity.Win.Editors.WrapMode.CharWrap
gctccw.Style.Multiline = MultiRowTriState.True
' MultiRowの設定
GcMultiRow1.Template = Template.CreateGridTemplate(New Cell() {gctcww, gctccw})
GcMultiRow1.Rows(0).Cells(0).VerticalResize(30)
GcMultiRow1.Columns(0).Width = 60
GcMultiRow1.Columns(1).Width = 60
' テストデータの設定
GcMultiRow1.SetValue(0, 0, "Your automobile is very expensive.")
GcMultiRow1.SetValue(0, 1, "Your automobile is very expensive.")
End Sub
End Class
[C#]
using GrapeCity.Win.MultiRow;
using GrapeCity.Win.MultiRow.InputMan;
namespace sample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// 単語単位で折り返し
GcTextBoxCell gctcww = new GcTextBoxCell();
gctcww.WrapMode = GrapeCity.Win.Editors.WrapMode.WordWrap;
gctcww.Style.Multiline = MultiRowTriState.True;
// 文字単位で折り返し
GcTextBoxCell gctccw = new GcTextBoxCell();
gctccw.WrapMode = GrapeCity.Win.Editors.WrapMode.CharWrap;
gctccw.Style.Multiline = MultiRowTriState.True;
// MultiRowの設定
gcMultiRow1.Template = Template.CreateGridTemplate(new Cell[] { gctcww, gctccw });
gcMultiRow1.Rows[0].Cells[0].VerticalResize(30);
gcMultiRow1.Columns[0].Width = 60;
gcMultiRow1.Columns[1].Width = 60;
// テストデータの設定
gcMultiRow1.SetValue(0, 0, "Your automobile is very expensive.");
gcMultiRow1.SetValue(0, 1, "Your automobile is very expensive.");
}
}
}