Home All Groups Group Topic Archive Search About

XY coordinates on form

Author
3 Jun 2006 1:57 PM
pcnerd
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.

Author
3 Jun 2006 7:48 PM
tomb
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
Author
3 Jun 2006 9:31 PM
pcnerd
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?

Show quoteHide quote
"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
>
Author
3 Jun 2006 9:35 PM
pcnerd
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?

Show quoteHide quote
"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
>
Author
3 Jun 2006 9:39 PM
pcnerd
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?

Show quoteHide quote
"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
>
Author
5 Jun 2006 2:36 PM
Chris Dunaway
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.
Author
5 Jun 2006 3:09 PM
pcnerd
> 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.

Show quoteHide quote
"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.
>
>
Author
6 Jun 2006 12:23 AM
Dennis
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


Show quoteHide quote
"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.
> >
> >
Author
6 Jun 2006 1:48 AM
pcnerd
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.

Show quoteHide quote
"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.
> > >
> > >
Author
6 Jun 2006 12:15 PM
C-Services Holland b.v.
pcnerd wrote:
Show quoteHide quote
> 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