GrapeCity.Win.MultiRow.v80 アセンブリ > GrapeCity.Win.MultiRow 名前空間 : TextBoxCell クラス |
TextBoxCellクラスは、編集可能な単一の文字列情報を表示する、特別なタイプのCellです。選択されたTextBoxCellはTextBoxEditingControlコントロールをホストし、ユーザーはその編集コントロールを使用してセルの値を編集できます(TextBoxCellのCell.ReadOnlyプロパティがfalseに設定されている場合)。
using System; using System.Windows.Forms; using System.Drawing; namespace GrapeCity.Win.MultiRow.SampleCode { public class TextBoxCellDemo : Form { private GcMultiRow gcMultiRow1 = new GcMultiRow(); [STAThreadAttribute()] public static void Main() { Application.EnableVisualStyles(); Application.Run(new TextBoxCellDemo()); } public TextBoxCellDemo() { this.gcMultiRow1.Dock = DockStyle.Fill; this.Text = "TextBoxCell Demo"; this.Controls.Add(this.gcMultiRow1); this.Load += new EventHandler(Form1_Load); this.Size = new Size(400, 350); } private void Form1_Load(object sender, EventArgs e) { TextBoxCell textBoxCell1 = new TextBoxCell(); //If the text cannot display completely, one '......' string will be shown at the text's end, hover the cell, the whole text will be shown in tool tip. textBoxCell1.Ellipsis = MultiRowEllipsisMode.EllipsisEnd; textBoxCell1.EllipsisString = "......"; //Enter the edit mode, the text will be highlight selected. textBoxCell1.HighlightText = true; textBoxCell1.Value = "DELETE THIS STRING TO INPUT BY YOURSELF, ONLY 10 CHARACTERS CAN BE INPUT"; textBoxCell1.MaxLength = 10; //The value will be casted to lower case. textBoxCell1.CharacterCasing = CharacterCasing.Lower; TextBoxCell textBoxCell2 = new TextBoxCell(); //Input text in textBoxCell2, it will be treated as password, always display '#'. textBoxCell2.PasswordChar = '#'; textBoxCell2.UseSystemPasswordChar = false; textBoxCell2.Value = "12345"; Template template1 = Template.CreateGridTemplate(new Cell[] { textBoxCell1, textBoxCell2 }, 160, AutoGenerateGridTemplateStyles.ColumnHeader | AutoGenerateGridTemplateStyles.RowHeaderAutoNumber); gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 3; } } }
Imports System Imports System.Windows.Forms Imports System.Drawing Imports GrapeCity.Win.MultiRow Public Class TextBoxCellDemo Inherits Form Private gcMultiRow1 As New GcMultiRow() Public Sub New() Me.gcMultiRow1.Dock = DockStyle.Fill Me.Text = "TextBoxCell Demo" Me.Controls.Add(Me.gcMultiRow1) Me.Size = New Size(400, 350) End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim textBoxCell1 As New TextBoxCell() 'If the text cannot display completely, one '......' string will be shown at the text's end, hover the cell, the whole text will be shown in tool tip. textBoxCell1.Ellipsis = MultiRowEllipsisMode.EllipsisEnd textBoxCell1.EllipsisString = "......" 'Enter the edit mode, the text will be highlight selected. textBoxCell1.HighlightText = True textBoxCell1.Value = "DELETE THIS STRING TO INPUT BY YOURSELF, ONLY 10 CHARACTERS CAN BE INPUT" textBoxCell1.MaxLength = 10 'The value will be casted to lower case. textBoxCell1.CharacterCasing = CharacterCasing.Lower Dim textBoxCell2 As New TextBoxCell() 'Input text in textBoxCell2, it will be treated as password, always display '#'. textBoxCell2.PasswordChar = "#"c textBoxCell2.UseSystemPasswordChar = False textBoxCell2.Value = "12345" Dim template1 As Template = Template.CreateGridTemplate(New Cell() {textBoxCell1, textBoxCell2}) gcMultiRow1.Template = template1 gcMultiRow1.RowCount = 3 End Sub <STAThreadAttribute()> _ Public Shared Sub Main() Application.EnableVisualStyles() Application.Run(New TextBoxCellDemo()) End Sub End Class
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
GrapeCity.Win.MultiRow.Cell
GrapeCity.Win.MultiRow.TextBoxCell
GrapeCity.Win.MultiRow.FilteringTextBoxCell