作成日: 2018/07/20 最終更新日: 2018/07/20
文書種別
使用方法
詳細
C1NumericEditのNegativeForeColorプロパティを使用すると、コントロールに負の数が入力された時の文字色を設定することができます。
※このプロパティは、C1TextBoxやC1ComboBoxコントロールに対しても同様に設定可能です。
◎サンプルコード(VB)
◎サンプルコード(C#)
※このプロパティは、C1TextBoxやC1ComboBoxコントロールに対しても同様に設定可能です。
◎サンプルコード(VB)
'C1NumericEditコントロール
C1NumericEdit1.NegativeForeColor = Color.Red
C1NumericEdit1.Value = -1111
'C1TextBoxコントロール
C1TextBox1.NumericInput = True
C1TextBox1.DataType = GetType(Int16)
C1TextBox1.NegativeForeColor = Color.Red
C1TextBox1.Value = -1111
'C1ComboBoxコントロール
C1ComboBox1.DataType = GetType(Int16)
C1ComboBox1.Items.Add(-1111)
C1ComboBox1.Items.Add(2222)
C1ComboBox1.Items.Add(3333)
C1ComboBox1.NegativeForeColor = Color.Red
C1ComboBox1.Value = -1111
C1NumericEdit1.NegativeForeColor = Color.Red
C1NumericEdit1.Value = -1111
'C1TextBoxコントロール
C1TextBox1.NumericInput = True
C1TextBox1.DataType = GetType(Int16)
C1TextBox1.NegativeForeColor = Color.Red
C1TextBox1.Value = -1111
'C1ComboBoxコントロール
C1ComboBox1.DataType = GetType(Int16)
C1ComboBox1.Items.Add(-1111)
C1ComboBox1.Items.Add(2222)
C1ComboBox1.Items.Add(3333)
C1ComboBox1.NegativeForeColor = Color.Red
C1ComboBox1.Value = -1111
◎サンプルコード(C#)
// c1NumericEditコントロール
c1NumericEdit1.NegativeForeColor = Color.Red;
c1NumericEdit1.Value = -1111;
// c1TextBoxコントロール
c1TextBox1.NumericInput = true;
c1TextBox1.DataType = typeof(Int16);
c1TextBox1.NegativeForeColor = Color.Red;
c1TextBox1.Value = -1111;
// c1ComboBoxコントロール
c1ComboBox1.DataType = typeof(Int16);
c1ComboBox1.Items.Add(-1111);
c1ComboBox1.Items.Add(2222);
c1ComboBox1.Items.Add(3333);
c1ComboBox1.NegativeForeColor = Color.Red;
c1ComboBox1.Value = -1111;
c1NumericEdit1.NegativeForeColor = Color.Red;
c1NumericEdit1.Value = -1111;
// c1TextBoxコントロール
c1TextBox1.NumericInput = true;
c1TextBox1.DataType = typeof(Int16);
c1TextBox1.NegativeForeColor = Color.Red;
c1TextBox1.Value = -1111;
// c1ComboBoxコントロール
c1ComboBox1.DataType = typeof(Int16);
c1ComboBox1.Items.Add(-1111);
c1ComboBox1.Items.Add(2222);
c1ComboBox1.Items.Add(3333);
c1ComboBox1.NegativeForeColor = Color.Red;
c1ComboBox1.Value = -1111;
旧文書番号
83062