Live Chat Icon For mobile
Live Chat Icon

How do I make the Context Menu to close after a set time interval?

Platform: WPF| Category: Context Menu

To automatically close the context menu after a set time interval, you can use a Timer and send an Esc keystroke after the desired time interval as shown.


private void timer1_Tick(object sender, System.EventArgs e)

private void contextMenu1_Popup(object sender, System.EventArgs e)
//set interval to 5 seconds
timer1.Interval = 5000;

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.