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 8578437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:23:20+00:00 2026-06-11T20:23:20+00:00

I am trying to fire the mouse right button click event of a Panel

  • 0

I am trying to fire the mouse right button click event of a Panel and call a function but its not firing. This is my code:

private void viewscreen_MouseClick(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Right)
    {
        generate_editpanel();
    }
}

“viewscreen” is a Panel. And my designer code is:

// viewscreen
// 
this.viewscreen.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.viewscreen.Location = new System.Drawing.Point(208, 16);
this.viewscreen.Name = "viewscreen";
this.viewscreen.Size = new System.Drawing.Size(370, 289);
this.viewscreen.TabIndex = 0;
this.viewscreen.MouseClick += 
    new System.Windows.Forms.MouseEventHandler(this.viewscreen_MouseClick);

Can any one help me?

  • 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-06-11T20:23:21+00:00Added an answer on June 11, 2026 at 8:23 pm

    The video object in your Panel must be covering up the whole area (docked) of the Panel. In that case the event of the panel wont’t get fired because all the clicks will take place on the video object.
    But if you still wish to fire the event of the panel you can modify the form designer code like this:

    this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseClick);
    this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.viewscreen_MouseClick);  
    

    Here I have docked a PictureBox(pictureBox1) in the panel(viewscreen). And now in the form code you can test like this:

    private void viewscreen_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right) 
            {
                MessageBox.Show(this, "Right Clicked on Panel");
            }            
        }
     private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
        {
            MessageBox.Show(this, "Picture Clicked");
            //this.viewscreen_MouseClick(sender, e);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fire a click event on my select options. This is working
I'm trying to fire a function when the keyup event happens. This works fine
I'm trying to fire a change event for a selected group radio button but
I am trying to build following gesture: Click And Hold Right Mouse Button, Click
Question: I am trying to fire a .click() event if a <ul></ul> element has
I am trying to fire an event from a unmanaged function using a pointer
I'm trying to extend a class like panel so that I can fire click
I'm trying to fire an event when a user clicks a hyperlink. But it
Im trying to fire a python function using a button created with MEL. So
Hi all i am trying to fire click event of a on input changing

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.