0

I have a Custom Control of following type in .NET C# Winforms

 public partial class AutoSuggestPopupList : ToolStripDropDown
 {
 }

It has got all its properties and methods. I am using it with a ListBoxControl and a textbox/combobox.

It is used in following manner: 1. As user types something in textbox/combobox 2. the list of ListBoxControl is refreshed and accordingly the items of AutoSuggestPopupList are refreshed.

I am closing my AutoSuggestPopupList in different Event Handlers and it gets closed appropriately. But my only problem is when I navigate to any other software like Word or Excel from my App, the AutoSuggestPopupList is not closed and is fixed at its location.

I have already tried using frm_LocationChanged and frm_VisibleChanged Event Handlers, but of no use :(

It will be a great help if some one can tell me which event handler will be useful for me , when i navigate to any other software.

Vandita
  • 708
  • 4
  • 13
  • possible duplicate of [Application 'Deactivate' event](http://stackoverflow.com/questions/1747562/application-deactivate-event) – Peter Duniho Mar 31 '15 at 05:20
  • I will note that while this wasn't included in the Winforms API, [it _is_ included for WPF](https://msdn.microsoft.com/en-us/library/system.windows.application.deactivated(v=vs.110).aspx), so if you switched to writing your program as a WPF program, you wouldn't need the (admittedly very simple) work-around shown in the duplicate question. – Peter Duniho Mar 31 '15 at 05:21
  • I have also tried to use Textbox_leave Event, but no use as Textbox does not loose focus and so the form also does not loose focus ! and i have tried the solution mentioned in [Application 'Deactivate' event](http://stackoverflow.com/questions/1747562/application-deactivate-event), but my problem persists by using mentioned solution ! – Vandita Mar 31 '15 at 05:38

0 Answers0