画面表示 - カラー
色の設定方法 -Activeプロパティ変更時の文字・背景色指定-
EditObjectクラスを継承するクラス(TextBox、EditBox、DateEdit等)には、
inactiveFgColor、inactiveBgColorプロパティに、Colorクラスを設定しておく事で、
Activeプロパティが変更されたタイミングで文字色や背景色を自動的に変更することができます。
EditObjectクラスを継承するクラスにつきまして、
詳細は該当のTips項目や、マニュアルをご確認下さい。
Form ScD0046 { x = 0; y = 0; width = 800; height = 600; BgColor = Color.White; border = new Border(Border.DOUBLE, 2, "#ff000000", 5); Label label1 { x = 13; y = 8; width = 777; height = 72; Font = new Font("メイリオ",16); horizontalAlign = ALIGN_CENTER; verticalAlign = ALIGN_CENTER; Value = "Activeプロパティの設定変更により、\nオブジェクトの文字色や背景色を変更する。"; border = new Border(Border.DOUBLE, 2, "#ff000000", 5); } GroupBox groupbox1 { x = 13; y = 107; width = 774; height = 475; TabIndex = 700; Border = New Border( Border.SOLID, 2, COLOR.BLACK, 10 ); titlePlacement = GROUPBOX_TOP; Title = "inactiveFgColor、inactiveBgColorプロパティによる文字色・背景色変更"; #TextBoxタイトル Label label2 { x = 25; y = 80; width = 100; horizontalAlign = ALIGN_RIGHT; verticalAlign = ALIGN_CENTER; height = 25; Value = "TextBox"; BgColor = COLOR.TRANSPARENT; } #TextBoxの設定サンプル TextBox textbox1 { x = 137; y = 80; width = 330; height = 25; horizontalAlign = ALIGN_LEFT; verticalAlign = ALIGN_CENTER; BgColor = COLOR.White; FgColor = COLOR.BLACK; #非アクティブ時の文字色設定 inactiveFgColor = COLOR.White; #ActiveにFalseが設定された時の変更文字色 inactiveBgColor = COLOR.DGRAY; #ActiveにFalseが設定された時の変更背景色 Value = "文字色、背景色が変更可能になります。"; } Button button1 { x = 485; y = 80; width = 72; height = 25; Title = "TRUE"; Function OnTouch( e ) { ^.textbox1.Active = true; } } Button button2 { x = 560; y = 80; width = 72; height = 25; Title = "FALSE"; Function OnTouch( e ) { ^.textbox1.Active = false; } } Label label3 { x = 25; y = 135; width = 100; horizontalAlign = ALIGN_RIGHT; verticalAlign = ALIGN_CENTER; height = 25; Value = "ComboBox"; BgColor = COLOR.TRANSPARENT; } #ComboBoxの設定サンプル ComboBox combobox1 { x = 137; y = 135; width = 331; height = 25; BgColor = COLOR.White; FgColor = COLOR.BLACK; #非アクティブ時の文字色設定 inactiveFgColor = COLOR.White; #ActiveにFalseが設定された時の変更文字色 inactiveBgColor = COLOR.DGRAY; #ActiveにFalseが設定された時の変更背景色 ComboItem item[]; item << CSV(.title) {文字色、背景色が変更可能になります。}; } Button button3 { x = 485; y = 135; width = 72; height = 25; Title = "TRUE"; Function OnTouch( e ) { ^.combobox1.Active = true; } } Button button4 { x = 560; y = 135; width = 72; height = 25; Title = "FALSE"; Function OnTouch( e ) { ^.combobox1.Active = false; } } #EditBoxの設定サンプル EditBox editbox1 { x = 137; y = 187; width = 331; height = 82; BgColor = COLOR.White; FgColor = COLOR.BLACK; #非アクティブ時の文字色設定 inactiveFgColor = COLOR.White; #ActiveにFalseが設定された時の変更文字色 inactiveBgColor = COLOR.DGRAY; #ActiveにFalseが設定された時の変更背景色 Value = "文字色、背景色が変更可能になります。"; } Label label4 { x = 25; y = 188; width = 100; horizontalAlign = ALIGN_RIGHT; verticalAlign = ALIGN_CENTER; height = 25; Value = "EditBox"; BgColor = COLOR.TRANSPARENT; } Button button5 { x = 485; y = 187; width = 72; height = 25; Title = "TRUE"; Function OnTouch( e ) { ^.editbox1.Active = true; } } Button button6 { x = 560; y = 187; width = 72; height = 25; Title = "FALSE"; Function OnTouch( e ) { ^.editbox1.Active = false; } } Label label5 { x = 25; y = 297; width = 100; horizontalAlign = ALIGN_RIGHT; verticalAlign = ALIGN_CENTER; height = 25; Value = "DateEdit"; BgColor = COLOR.TRANSPARENT; } #DateEditの設定サンプル DateEdit dateedit1 { x = 137; y = 297; width = 331; height = 25; BgColor = COLOR.White; FgColor = COLOR.BLACK; #非アクティブ時の文字色設定 inactiveFgColor = COLOR.White; #ActiveにFalseが設定された時の変更文字色 inactiveBgColor = COLOR.DGRAY; #ActiveにFalseが設定された時の変更背景色 Value = "文字色、背景色が変更可能になります。"; } Button button7 { x = 485; y = 297; width = 72; height = 25; Title = "TRUE"; Function OnTouch( e ) { ^.dateedit1.Active = true; } } Button button8 { x = 560; y = 297; width = 72; height = 25; Title = "FALSE"; Function OnTouch( e ) { ^.dateedit1.Active = false; } } #CheckBoxの設定サンプル CheckBox checkbox1 { x = 137; y = 350; width = 331; height = 25; BgColor = COLOR.White; FgColor = COLOR.BLACK; CheckItem item[1] { x = 8; y = 0; width = 300; height = 20; } this.item[0].Title = "文字色、背景色が変更可能になります。"; this.item[0].Width = 300; this.item[0].BgColor = COLOR.White; this.item[0].FgColor = COLOR.BLACK; #非アクティブ時の文字色設定 this.item[0].inactiveFgColor = COLOR.White; #ActiveにFalseが設定された時の変更文字色 this.item[0].inactiveBgColor = COLOR.DGRAY; #ActiveにFalseが設定された時の変更背景色 } Button button9 { x = 485; y = 350; width = 72; height = 25; Title = "TRUE"; Function OnTouch( e ) { ^.checkbox1.Active = true; } } Button button10 { x = 560; y = 350; width = 72; height = 25; Title = "FALSE"; Function OnTouch( e ) { ^.checkbox1.Active = false; } } Label label6 { x = 25; y = 351; width = 100; horizontalAlign = ALIGN_RIGHT; verticalAlign = ALIGN_CENTER; height = 25; Value = "CheckBox"; BgColor = COLOR.TRANSPARENT; } #NumberEditの設定サンプル NumberEdit numberedit1 { x = 137; y = 402; width = 330; height = 25; BgColor = COLOR.White; FgColor = COLOR.BLACK; #非アクティブ時の文字色設定 inactiveFgColor = COLOR.White; #ActiveにFalseが設定された時の変更文字色 inactiveBgColor = COLOR.DGRAY; #ActiveにFalseが設定された時の変更背景色 } Label label1 { x = 25; y = 401; width = 100; horizontalAlign = ALIGN_RIGHT; verticalAlign = ALIGN_CENTER; height = 25; Value = "NumberEdit"; BgColor = COLOR.TRANSPARENT; } Button button11 { x = 485; y = 400; width = 72; height = 25; Title = "TRUE"; Function OnTouch( e ) { ^.numberedit1.Active = true; } } Button button12 { x = 560; y = 400; width = 72; height = 25; Title = "FALSE"; Function OnTouch( e ) { ^.numberedit1.Active = false; } } Label label8 { x = 54; y = 42; width = 420; horizontalAlign = ALIGN_CENTER; verticalAlign = ALIGN_TOP; Border = New Border( Border.SOLID, 2, COLOR.BLACK, 10 ); height = 396; Value = "\nEditObjectを継承しているクラス"; BgColor = COLOR.TRANSPARENT; } Label label7 { x = 478; y = 42; width = 161; horizontalAlign = ALIGN_CENTER; verticalAlign = ALIGN_TOP; Border = New Border( Border.SOLID, 2, COLOR.BLACK, 10 ); height = 396; Value = "\nActive設定値"; BgColor = COLOR.TRANSPARENT; } } }
Biz-Collections Bizの宝箱 トップへ
Biz/Browser DT・Biz/Designer DT TIPS集 トップへ