作成日: 2024/01/31 最終更新日: 2024/01/31
文書種別
使用方法
詳細
GcNumber型セルにて提供されている電卓では、キーボード操作で電卓を操作([Enter]キーにて確定、[Delete]キーによるクリアなど)することができます。
電卓のスタイルはコード上から変更することも可能です。
[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 numberCell As New GcNumberCell
' 電卓のボタンのテキストを変更
numberCell.DropDownCalculator.ButtonText.Add("*", "×")
numberCell.DropDownCalculator.ButtonText.Add("/", "÷")
' 電卓のスタイルを変更
numberCell.Style.TextEffect = TextEffect.Sunken
numberCell.DropDownCalculator.FlatStyle = FlatStyle.Flat
numberCell.DropDownCalculator.MathButtons.BackColor = Color.Blue
numberCell.DropDownCalculator.MathButtons.ForeColor = Color.Red
' MultiRowの設定
GcMultiRow1.Template = Template.CreateGridTemplate(New Cell() {numberCell})
GcMultiRow1.RowCount = 5
End Sub
End Class
[C#]
using GrapeCity.Win.MultiRow.InputMan;
using GrapeCity.Win.MultiRow;
namespace sample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// セル型の作成
GcNumberCell numberCell = new GcNumberCell();
// 電卓のボタンのテキストを変更
numberCell.DropDownCalculator.ButtonText.Add("*", "×");
numberCell.DropDownCalculator.ButtonText.Add("/", "÷");
// 電卓のスタイルを変更
numberCell.Style.TextEffect = TextEffect.Sunken;
numberCell.DropDownCalculator.FlatStyle = FlatStyle.Flat;
numberCell.DropDownCalculator.MathButtons.BackColor = Color.Blue;
numberCell.DropDownCalculator.MathButtons.ForeColor = Color.Red;
// MultiRowの設定
gcMultiRow1.Template = Template.CreateGridTemplate(new Cell[] { numberCell});
gcMultiRow1.RowCount = 5;
}
}
}