Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
UltraCombo Lastfocus Event
posted

Hi All,

   I am using Infragistics UltraCombo in my window application, I have written some logic in Lastfocus event of Ultracombo box, but when executing the application when i click the Ultracombo it's getting executed UltraCombo Lastfocus event. that too it's executing the same event more than 5 times.

 Please let me know why it's executing like this.


Thanks

Mohan

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Mohan,  

        I assume you mean LostFocus. You should not use LostFocus, really.
    Microsoft even advises against it because this event is tied directly to
    Windows messages and won't always make sense to a DotNet developer. You
    should use the Leave event instead.
        Just in case you are curious, the reason LostFocus is firing when you
    click on the control is because the UltraCombo uses a TextBox for editing.
    So when you click on the control, it gets focus and then it immediately
    creates a TextBox and positions it over the Combo and sets focus to the
    TextBox. Thus the TextBox gets focus and the Combo loses it.
        Hence one reason why Enter and Leave perferrable to GotFocus/LostFocus.
     

Children