How change the forecolor?

Stimulsoft Reports.NET discussion
Post Reply
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

How change the forecolor?

Post by jjc »

Hi ,
i have a Button in a stiForm with this code:

if (CheckedListBoxControl4.SelectedIndex >= 0)

{
for (int i=0; i<CheckedListBoxControl4.Control.CheckedItems.Count; i++)
{
string vari = CheckedListBoxControl4.Control.CheckedItems.ToString();

Hotel_Meals_TBL.First();

while (!Hotel_Meals_TBL.IsEof)
{
switch(vari)

{
case ("GOLDEN PALACE") :
chkGOLDENPALACE.Checked = true;
chkGOLDENPALACE.ForeColor = Color.Red;
break;

case ("KHEMARA BATTAMBANG") :
chkKHEMARABATTAMBANG.Checked = true;
txtKHEMARABATTAMBANG.Brush =new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red);
break;

case ("LA VILLA") :
chkLAVILLA.Checked = true;
break;




}
Hotel_Meals_TBL.Next();
}
}
}


when a CheckedBox is checked(true) i wish change the ForeColor of the TextBox but with my code i can not.

Where i wrong in my code?

Thanks for your attention.

Have a good day.

Cheers
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

How change the forecolor?

Post by Ivan »

Hello,

For change color of textbox please use the following code, for example:

Code: Select all

TextBoxControl1.Control.ForeColor = Color.Red;
Thank you.
jjc
Posts: 97
Joined: Mon Apr 19, 2010 10:14 pm

How change the forecolor?

Post by jjc »

Hi Ivan,
your code is right , i can change he forecolor of the textbox.:blush:

Thanks so much for your support.

Have a good day.

Cheers
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

How change the forecolor?

Post by Andrew »

Have a good day too! :biggrin:
Post Reply