Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6943153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:07:08+00:00 2026-05-27T13:07:08+00:00

How can I create a small menu which pop-ups next to cursor in WPF

  • 0

How can I create a small menu which pop-ups next to cursor in WPF with C#. This menu will work out of the application window. For example;

I move my cursor and stop it on the desktop. When it stops, there will be a small menu which is just next to the cursor and show up.

Thanks

The CODE:

    static System.Windows.Forms.Timer myTimer = new System.Windows.Forms.Timer();

    public void TimerEventProcessor(Object myObject, EventArgs myEventArgs)
    {
        big.Visibility = Visibility.Hidden;
        myTimer.Stop();              
    }

    public void TimerEventProcessor2(Object myObject, EventArgs myEventArgs)
    {
        big.Visibility = Visibility.Visible;
        myTimer.Stop();
    }

    public MainWindow()
    {
        InitializeComponent();
        // Sets the timer interval to 5 seconds.
        myTimer.Interval = 5000;
        myTimer.Start();
        myTimer.Tick += new EventHandler(TimerEventProcessor);

        myTimer.Start(); 
        myTimer.Tick += new EventHandler(TimerEventProcessor2);
    }

EDIT2

This is the part of the code. I created another dispatchertimer whish has a name hidingtimer. I defined the time as 3 seconds as you see on the code. And this timer calls deneme_Tick then I do the same things as HideWindow() in your code.

        timer.Interval = new TimeSpan(0, 0, 0, 1);
        timer.Tick += (sd, args) =>
        {
            movingCount++;

            if (movingCount >= menuShowDelay)
            {
                this.Visibility = System.Windows.Visibility.Visible;
                mouse.Enabled = false;
                timer.Stop();
                this.Left = mouseLeft;
                this.Top = mouseTop;
                this.Topmost = true;

                hidingtimer.Interval = new TimeSpan(0, 0, 0, 3);
                hidingtimer.Start();
                hidingtimer.Tick += new EventHandler(deneme_Tick);

                movingCount = 0;
            }



        };
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:07:09+00:00Added an answer on May 27, 2026 at 1:07 pm

    (sorry for my bad english)

    This is how I would do it:

    • Create your menu in WPF any way you want (it could be a real menu or a listbox, buttons on a stackpanel, etc).
    • Set your WindowStyle to None.
    • To detect mouse movement and position you could use this library
    • Write some logic to show/hide the window on the mouse position (with a timer to detect when the mouse isn’t moving for X seconds)

    If you need more details on how to acomplish those steps, let me know 🙂

    EDIT 1

    You can use the library to detect mouse movement like this:

    mouse = new MouseKeyboardActivityMonitor.MouseHookListener(new GlobalHooker());
    mouse.MouseMove += (sd, args) =>
            {
                movingCount = 0;
                mouseLeft = args.X; //set the window.left to mouseLeft before showing it
                mouseTop = args.Y; //set the window.top to mouseTop before showing it
            };
    
    mouse.Enabled = true;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small offline app which you can create boxes dynamically and the
I just got homework to create a lua menu which is as small as
I'm trying to create a small Javascript framework that I can use in my
I would like to create a small Windows Messenger Client that I can trigger
My Cocoa app needs some small dynamically generated windows. How can I programmatically create
I can create a menu item in the Windows Explorer context menu by adding
I installed Xcode 4 with IOS 4.3 and I create an small application, but
I used a small tutorial to create a menu through the Navigation_Menu view helper.
I'm developing a small j2me game and i want to create a menu for
I am creating a small reservation system. you can create nodes of a type

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.