Lance H
Lance H

Reputation: 954

Click textbox to show popup, click outside to close popup

I am designing a WPF usercontrol, and there is a textbox and a popup under the textbox. I want to click the textbox, then the popup shows. If I click outside of the textbox, the popup closes.

Now the problem is how to unfocus the textbox if I click outside the usercontrol area? Is any better way to design this control? Thanks.

Upvotes: 0

Views: 1061

Answers (1)

Lonli-Lokli
Lonli-Lokli

Reputation: 3766

On click inside you should show your popup, and to close it ater click on non-user are try to use solutions from link Is there an event handler that is fired when mouse is clicked outside textbox in c# Windows Form application?

Upvotes: 0

Related Questions