473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 4193
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.PrimaryScreen property to get the primary
display screen. Or you can use Screen.AllScreens 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.PrimaryScreen property to get the primary
display screen. Or you can use Screen.AllScreens 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.PrimaryScreen property to get the primary
display screen. Or you can use Screen.AllScreens 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.PrimaryScreen property to get the primary
display screen. Or you can use Screen.AllScreens 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
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...
4
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)...
3
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...
0
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:...
3
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...
3
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'...
3
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...
1
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.