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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:15:30+00:00 2026-05-13T09:15:30+00:00

I use the function PointToScreen to get the screen related point of the control

  • 0

I use the function PointToScreen to get the screen related point of the control it gives proper value if I use this function for the toolstrip which is top on the form, but if there is menustrip on the top of the form and then under the menustrip, toolstrip is there then the function does not give proper value of screen point for the control toolstrip.

So,when I use this function for the toolstrip which is top on the form right now then it gives proper location like it gives Y position of 26 which is ok.

Now I am adding the menustrip top of the form and toolstrip is now under the menustrip and now if I use the function then it does not give proper value like,it gives y position of 74,which should be (26 + height of menustrip) = 50.

  • 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-13T09:15:30+00:00Added an answer on May 13, 2026 at 9:15 am

    I would verify that you are calling PointToScreen on the correct control. If you want to find the location of a control in screen coordinates, call PointToScreen on its parent control.

    For example:

    control.Parent.PointToScreen(control.Location);
    

    If you call PointToScreen on the control itself using a point relative to the parent control (such as Control.Location), you will get the wrong location.

    For example:

    Lets say control.Location = new Point(0, 20). If the parent is located at (100, 100) relative to the desktop, then the desktop position of the control is (100, 120). If you call PointToScreen on the parent control, then you will get (100, 120). If you call PointToScreen on the control itself, you will get the location of the point (0, 20) relative to the desktop location of the control, which would end up being (100, 140).

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

Sidebar

Related Questions

I am getting this error: Fatal error: Can't use function return value in write
I use function below to check connection to WiFi hotspot point: public boolean IsWiFiConnected(){
I use DATEDIFF function to filter records added this week only: DATEDIFF(week, DateCreated, GETDATE())
I use this function to find any installed application . But the parameter InstallLocation
I use this function substr(tbarticles.articlebody,1,200) as description1 in a query but for some articles
I need to use function image_path in my lib class. I tried this (and
I have an array called $results, when I use function: print_r($results); I get the
I'm trying to use function pointers and Abstract data types in c. This is
When I load my page I'm getting this error: Fatal error: Can't use function
Here is my program which reverses a string. I am trying to use function

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.