473,789 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XY coordinates on form

I created a demo program with a status bar & status bar label on the form.
When the program runs, it's maximized. When I move the mouse over the form, I
can see the X & Y coordinates changing on the status bar label. Here's the
problem. I have a 19" LCD monitor with a resolution of 1280 by 1024. When the
program runs & the mouse is in the upper-left corner, the X & Y coordinates
are 0,0. When the mouse is in the lower-right corner, the X & Y coordinates
are 1279,941. OK, if someone installs this program (I know that it really
doesn't do anything.) on his computer & he has, say, a 17" CRT monitor with a
resolution of 800 by 600, will the resolution on the form still be 1279 by
941 or will it be 800 by 600? I want to be able to do graphics programs like
fractals & stuff & I want the resolution on the form to be independent of the
monitor size. Is that possible? Thank you.
Jun 3 '06 #1
9 4216
pcnerd wrote:
I created a demo program with a status bar & status bar label on the form.
When the program runs, it's maximized. When I move the mouse over the form, I
can see the X & Y coordinates changing on the status bar label. Here's the
problem. I have a 19" LCD monitor with a resolution of 1280 by 1024. When the
program runs & the mouse is in the upper-left corner, the X & Y coordinates
are 0,0. When the mouse is in the lower-right corner, the X & Y coordinates
are 1279,941. OK, if someone installs this program (I know that it really
doesn't do anything.) on his computer & he has, say, a 17" CRT monitor with a
resolution of 800 by 600, will the resolution on the form still be 1279 by
941 or will it be 800 by 600? I want to be able to do graphics programs like
fractals & stuff & I want the resolution on the form to be independent of the
monitor size. Is that possible? Thank you.

You can change your own resolution and test it.

T
Jun 3 '06 #2
As I previously stated, I have an LCD monitor. If I changed the resolution,
everything would be fuzzy. Is there another way to test it?

"tomb" wrote:
pcnerd wrote:
I created a demo program with a status bar & status bar label on the form.
When the program runs, it's maximized. When I move the mouse over the form, I
can see the X & Y coordinates changing on the status bar label. Here's the
problem. I have a 19" LCD monitor with a resolution of 1280 by 1024. When the
program runs & the mouse is in the upper-left corner, the X & Y coordinates
are 0,0. When the mouse is in the lower-right corner, the X & Y coordinates
are 1279,941. OK, if someone installs this program (I know that it really
doesn't do anything.) on his computer & he has, say, a 17" CRT monitor with a
resolution of 800 by 600, will the resolution on the form still be 1279 by
941 or will it be 800 by 600? I want to be able to do graphics programs like
fractals & stuff & I want the resolution on the form to be independent of the
monitor size. Is that possible? Thank you.

You can change your own resolution and test it.

T

Jun 3 '06 #3
As I previously stated, I have an LCD monitor. If I change the resolution,
everything will be fuzzy. Is there another way to test it?

"tomb" wrote:
pcnerd wrote:
I created a demo program with a status bar & status bar label on the form.
When the program runs, it's maximized. When I move the mouse over the form, I
can see the X & Y coordinates changing on the status bar label. Here's the
problem. I have a 19" LCD monitor with a resolution of 1280 by 1024. When the
program runs & the mouse is in the upper-left corner, the X & Y coordinates
are 0,0. When the mouse is in the lower-right corner, the X & Y coordinates
are 1279,941. OK, if someone installs this program (I know that it really
doesn't do anything.) on his computer & he has, say, a 17" CRT monitor with a
resolution of 800 by 600, will the resolution on the form still be 1279 by
941 or will it be 800 by 600? I want to be able to do graphics programs like
fractals & stuff & I want the resolution on the form to be independent of the
monitor size. Is that possible? Thank you.

You can change your own resolution and test it.

T

Jun 3 '06 #4
As I previously stated, I have an LCD monitor. If I change the resolution,
everything will get fuzzy. Is there any other way to test it?

"tomb" wrote:
pcnerd wrote:
I created a demo program with a status bar & status bar label on the form.
When the program runs, it's maximized. When I move the mouse over the form, I
can see the X & Y coordinates changing on the status bar label. Here's the
problem. I have a 19" LCD monitor with a resolution of 1280 by 1024. When the
program runs & the mouse is in the upper-left corner, the X & Y coordinates
are 0,0. When the mouse is in the lower-right corner, the X & Y coordinates
are 1279,941. OK, if someone installs this program (I know that it really
doesn't do anything.) on his computer & he has, say, a 17" CRT monitor with a
resolution of 800 by 600, will the resolution on the form still be 1279 by
941 or will it be 800 by 600? I want to be able to do graphics programs like
fractals & stuff & I want the resolution on the form to be independent of the
monitor size. Is that possible? Thank you.

You can change your own resolution and test it.

T

Jun 3 '06 #5
pcnerd wrote:
As I previously stated, I have an LCD monitor. If I change the resolution,
everything will get fuzzy. Is there any other way to test it?


If the program is maximized, it should be displayed as the resolution
of the system on which it is running.

You can check the Screen.PrimaryS creen property to get the primary
display screen. Or you can use Screen.AllScree ns to get all the screens
in an array.

Jun 5 '06 #6
If the program is maximized, it should be displayed as the resolution
of the system on which it is running.
That's what I thought. I had a 17" CRT monitor & I played around with
classic VB graphics. I figured that the XY coordinates on a form are
independent of the resolution & you confirmed it. It doesn't matter what the
screen size or resolution are. That's a good thing to know. Thank you.

"Chris Dunaway" wrote:
pcnerd wrote:
As I previously stated, I have an LCD monitor. If I change the resolution,
everything will get fuzzy. Is there any other way to test it?


If the program is maximized, it should be displayed as the resolution
of the system on which it is running.

You can check the Screen.PrimaryS creen property to get the primary
display screen. Or you can use Screen.AllScree ns to get all the screens
in an array.

Jun 5 '06 #7
JUst trying to understand you correctly. Do you mean that on your 17"
monitor that if you change the screen resolution to 800 x 600, the mouse X,Y
in the lower right hand corner still shows 1279, 941?
--
Dennis in Houston
"pcnerd" wrote:
If the program is maximized, it should be displayed as the resolution
of the system on which it is running.


That's what I thought. I had a 17" CRT monitor & I played around with
classic VB graphics. I figured that the XY coordinates on a form are
independent of the resolution & you confirmed it. It doesn't matter what the
screen size or resolution are. That's a good thing to know. Thank you.

"Chris Dunaway" wrote:
pcnerd wrote:
As I previously stated, I have an LCD monitor. If I change the resolution,
everything will get fuzzy. Is there any other way to test it?


If the program is maximized, it should be displayed as the resolution
of the system on which it is running.

You can check the Screen.PrimaryS creen property to get the primary
display screen. Or you can use Screen.AllScree ns to get all the screens
in an array.

Jun 6 '06 #8

No, I set my 17" CRT monitor to a resolution of 800 by 600.

Last year, I got a new PC & a new 19" LCD monitor. My 19" LCD monitor has a
resolution of 1280 by 1024.

When I run the program on my 19" monitor, the form is maximized. The X & Y
coordinates at the upper-left are 0,0. At the lower-right, they are 1279,941.

It makes sense that the resolution on the form is independent of the size of
the monitor. I guess that VB adjusts the resolution of the form to correspond
to the resolution of the monitor. If I had to create a different program to
run on every conceivable monitor size & resolution, I'd go crazy. Thank you.

"Dennis" wrote:
Just trying to understand you correctly. Do you mean that on your 17"
monitor that if you change the screen resolution to 800 x 600, the mouse X,Y
in the lower right hand corner still shows 1279, 941?
--
Dennis in Houston
"pcnerd" wrote:
If the program is maximized, it should be displayed as the resolution
of the system on which it is running.


That's what I thought. I had a 17" CRT monitor & I played around with
classic VB graphics. I figured that the XY coordinates on a form are
independent of the resolution & you confirmed it. It doesn't matter what the
screen size or resolution are. That's a good thing to know. Thank you.

"Chris Dunaway" wrote:
pcnerd wrote:
> As I previously stated, I have an LCD monitor. If I change the resolution,
> everything will get fuzzy. Is there any other way to test it?

If the program is maximized, it should be displayed as the resolution
of the system on which it is running.

You can check the Screen.PrimaryS creen property to get the primary
display screen. Or you can use Screen.AllScree ns to get all the screens
in an array.

Jun 6 '06 #9
pcnerd wrote:
No, I set my 17" CRT monitor to a resolution of 800 by 600.

Last year, I got a new PC & a new 19" LCD monitor. My 19" LCD monitor has a
resolution of 1280 by 1024.

When I run the program on my 19" monitor, the form is maximized. The X & Y
coordinates at the upper-left are 0,0. At the lower-right, they are 1279,941.

It makes sense that the resolution on the form is independent of the size of
the monitor. I guess that VB adjusts the resolution of the form to correspond
to the resolution of the monitor. If I had to create a different program to
run on every conceivable monitor size & resolution, I'd go crazy. Thank you.

"Dennis" wrote:


The size of a monitor doesn't really say much about the resolution your
desktop is set to (i.e. my 19" is running in 1600x1200). also remember
that the 1279,941 is variable even on a 1280x1024 resolution. If a user
increases the size of his taskbar the 941 will change. If he sets it to
autohide it will change. If he moves the taskbar to the side it will
change as will the 1279 value.

My point: detect how much space you have available at runtime and don't
assume anything about an endusers resolution while programming.

--
Rinze van Huizen
C-Services Holland b.v
Jun 6 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2024
by: Dino M. Buljubasic | last post by:
I am trying to get coordinates of mouse_down/mouse_up event BUT relevant to the form or the parent of a control, not to the control where mouse click has occured. That means, even if I click a control on the form, I want to get the coordinates of the form of the click event, not coordinates of the control that was clicked on. My user controls are on a panel pnToday. Each user control has two text boxes inside representing whole and half...
4
3671
by: K.N.Ranjit | last post by:
Hi to all friends out there, I'm facing this problem for atleast 2 days but still have'nt yet solved my problem.I send the mail few days back (ie) in VB.net how to shift my form coordinates (ie) by default (0,0) is in the top-left corner of the form but right now I need it in the bottom left corner of my form (ie) my (0,0) coordinates.I dont know coding.I tried changing the form property location but this location property is to place...
3
63441
by: Tom | last post by:
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and display (in the status bar) the image coordinates of the mouse location. However, if I use the picturebox's MouseMove event, I am getting the coordinates of the mouse over the PICTUREBOX, not the actual image underneath that (which is stretched)....
0
3479
by: deko | last post by:
I'm trying to implement a custom TreeView that shows a ghost image while dragging. But the form I'm using is different from the sample code found here: http://www.codeproject.com/cs/miscctrl/TreeViewDragDrop.asp The problem is I can't get the proper coordinates required when dragging begins. I have two tree views in a panel with a splitter, and the panel is on a TabControl. The sample code just has a simple form with the treeview...
3
5417
by: steve | last post by:
Hi All I have textboxes within a TableLayoutpanel and I want to be able to position an independant control adjacent to a selected textbox This independent control allows selection of text to insert into the textbox I am having trouble achieving this, see code below, the x position is too far to the right and the y position is close to the bottom of the textbox and I want it to be side by side.
3
21273
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image' src='picture.gif' name='myimage' id='myimage'> </form> When forms with image types are submitted, the value is not returned; instead, when the form is submitted, the XY coordinates of the where the user clicked on the image are sent. For example, if the user
3
22535
by: Andrzej | last post by:
I have a picturebox on my C# .NET form. The picturebox size mode is set to zoom. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and display (in the status bar) the image coordinates of the mouse location. However, if I use the picturebox's MouseMove event, I am getting the coordinates of the mouse over the PICTUREBOX, not the actual image underneath that (which is zoomed). i.e....
1
2316
by: Cainnech | last post by:
Hi all, I've got a bit of a challenge. I've got a script which displays the mouse coodinates if you click on an image. Now I would like to convert these coordinates to pixelnumber. Let me see if I can make it easier. Suppose we have an image which is 100px high and 100px wide. The coordinates of the upper left corner would be x=0 and y=0 The coordinates of the upper right corner would be x=99 and y=0 The coordinates of the lower left...
0
8951
by: raylopez99 | last post by:
keywords: logical coordinates, page coordinates, world coordinates, device coordinates, physical coordinates, screen coordinates, client coordinates. offset rectangle. WYSIWYG rubber rectangle problem, bounded rectangle problem. PointToClient, PointToScreen Beware this newbie trap for the unwary. It goes by various names (in some old MFC literature I saw some of the keywords above). Whenever doing comparisons between points,...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10412
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.