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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:10:56+00:00 2026-06-04T08:10:56+00:00

When I doubleclick in Static Control, I will draw ellipse in Static Control in

  • 0

When I doubleclick in Static Control, I will draw ellipse in Static Control in the position of mouse.(MFC);
But, It apears that:
suprised

And My code:

void CTreeShowLabel::OnLButtonDblClk(UINT nFlags, CPoint point)

{

//设置画笔

COLORREF black = RGB(255, 0, 0);

CPen pen(PS_SOLID, 1, black);

CClientDC Dc(GetDlgItem(IDC_TREESTATIC));

Dc.SelectObject(pen);

//在鼠标处画图
CPoint curPos;
GetCursorPos(&curPos);

CPoint point1(0,0);
point1.x = curPos.x - 50;
point1.y = curPos.y - 50;

CPoint point2(0,0);
point2.x = curPos.x + 50;
point2.y = curPos.y + 50;

    //画圆
Dc.Ellipse(CRect(point1, point2));
CStatic::OnLButtonDblClk(nFlags, point);

}

About the Circle is terrible.

  • 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-04T08:10:58+00:00Added an answer on June 4, 2026 at 8:10 am

    It doesn’t seem a good idea to draw the ellipse in the OnLButtonDblClk event catcher. You should create your own class derived from CStatic and overwrite the OnPaint method.

    Then from the event catcher you should tell the static that it has to draw the ellipse and where (for instance two member variables: bool m_bDraw / CPoint m_DrawingPoint) and call Invalidate in the Static.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to run slot only on doubleClick with left button mouse, instead of
Hi friends I got sample code for Pane Manager from blackberry samples but when
I have page with many doubleclick scripts I have js code inserted at the
I use an attached behavior that allows a DoubleClick event to be wired to
looking a way to make a toggle on doubleclick, this is my code: $('#mydiv').toggle(function()
How do I capture a doubleclick event of the System.Windows.Forms.MonthCalendar control? I've tried using
I had written a program: public class SystemShutdown { public static void main(String[] args)
For ease I'll use hello world... public class HelloWorld{ public static void main (String
Here I have a code for sum 3 numbers i+j+k but I waht to
i create a new form using the code below. private void CNPictureBox2_DoubleClick(object sender, EventArgs

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.