in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1NumericEdit And C1TextBox does not change BackColor And ForeColor in GotFocus/LostFocus

Last post 06-25-2008 2:33 AM by akdeniz. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-24-2008 7:50 AM

    C1NumericEdit And C1TextBox does not change BackColor And ForeColor in GotFocus/LostFocus

    I searched the forum, but couldn't find any answers.

    As I described my problem in subject I am trying to change colors of these control when focus enter them and left them. I have multiple instances of these controls and there is one GotFocus and one LostFocus event registered to them. When a control has focus, in debug mode I can see the change of the BackColor property of the control perfectly. But after the execute of the code there were nothing changed. Also the control that catches the focus infinitely loops between LostFocus and GotFocus.(GotFocus fires, LostFocus fires, GotFocus fires, ... ) I tries Enter/Leave events, but the difference was there were no loop and it didn't work too. These events works for normal TextBox perfectly.

     I am using 2.0.20073.33104 file version of C1Input and Runtime version is v2.0.50727.

     Thanks for replies.

    Regards, Emrah

  • 06-24-2008 6:14 PM In reply to

    Re: C1NumericEdit And C1TextBox does not change BackColor And ForeColor in GotFocus/LostFocus

    Hi Emrah,
     
    I have attached a small sample which how we can change the BackColor and ForeColor of C1DateEdit and C1NumericEdit control.
     
    The BackColor and ForeColor works fine in GotFocus and LostFocus events.
     
    Hope this helps.
     
    Regards,
    John Adams
     
    <akdeniz> wrote in message news:206342@10.0.1.98...

    I searched the forum, but couldn't find any answers.

    As I described my problem in subject I am trying to change colors of these control when focus enter them and left them. I have multiple instances of these controls and there is one GotFocus and one LostFocus event registered to them. When a control has focus, in debug mode I can see the change of the BackColor property of the control perfectly. But after the execute of the code there were nothing changed. Also the control that catches the focus infinitely loops between LostFocus and GotFocus.(GotFocus fires, LostFocus fires, GotFocus fires, ... ) I tries Enter/Leave events, but the difference was there were no loop and it didn't work too. These events works for normal TextBox perfectly.

     I am using 2.0.20073.33104 file version of C1Input and Runtime version is v2.0.50727.

     Thanks for replies.

    Regards, Emrah



    http://helpcentral.componentone.com/cs/forums/p/75667/206342.aspx#206342

  • 06-25-2008 2:33 AM In reply to

    Re: C1NumericEdit And C1TextBox does not change BackColor And ForeColor in GotFocus/LostFocus

    Hi John,

    Thanks for replay and example. I solved the problem. I was casting sender object to Control and setting both Fore and Back colors. I cast the sender to it's real type(C1NumericEdit, C1TextBox, etc) and the colors set fine.

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.