change in coordinates in form

K

K.N.Ranjit

Hi,
This is the 4th mail I'm sending regarding this problem.
I'm really not been able to sort this problem out.I'm not
been able to change my starting position of my cordinates
from top-left to bottom-left of my form.Thrice I got the
reply but unfortunately it did'nt work.Here is my coding.
private sub form_load(...)
dim y as integer
y=me.height
location.y = 0-y
In this place (ie) location.y is showing me a design error
itself.I actually wanted to use e.y but its not
recognizing in any object (ie) if I give (e.) then its not
showing me the contents whereas in form_mousemove alone
e.y is being shown.

Iam really waiting desperately for the full coding in
form_load (ie)I want to draw a line keeping my staring
cordinate in the bottom-left of the form.

Please .... provide me the coding.
Last time I got the reply like this y=maxheight-y
This didnt work out.
e.y signifies y coordintes
e.x signifies x coordinates.
if i give y = maxheight-y then I need to declare y but
practically not possible.

Anyway Please .... provide me the coding.
Thanking You,
K.N.Ranjit
 
H

Herfried K. Wagner [MVP]

* "K.N.Ranjit said:
Hi,
This is the 4th mail I'm sending regarding this problem.
I'm really not been able to sort this problem out.I'm not
been able to change my starting position of my cordinates
from top-left to bottom-left of my form.Thrice I got the
reply but unfortunately it did'nt work.Here is my coding.
private sub form_load(...)
dim y as integer
y=me.height
location.y = 0-y
In this place (ie) location.y is showing me a design error
itself.I actually wanted to use e.y but its not
recognizing in any object (ie) if I give (e.) then its not
showing me the contents whereas in form_mousemove alone
e.y is being shown.

It will only work in an event handler with a parameter called 'e' of
appropriate type.
Iam really waiting desperately for the full coding in
form_load (ie)I want to draw a line keeping my staring
cordinate in the bottom-left of the form.

Please .... provide me the coding.
Last time I got the reply like this y=maxheight-y
This didnt work out.
e.y signifies y coordintes
e.x signifies x coordinates.
if i give y = maxheight-y then I need to declare y but
practically not possible.

Where does the drawing take place? In the form's 'OnPaint' method or
'Paint' event handler?
 
A

Armin Zingler

K.N.Ranjit said:
Hi,
This is the 4th mail I'm sending regarding this problem.

Please stay in the same thread. Don't open a new one each time.

You can not paint on the Form in Form_Load because the Form is not visible
yet.

I'm really not been able to sort this problem out.I'm not
been able to change my starting position of my cordinates
from top-left to bottom-left of my form.Thrice I got the
reply but unfortunately it did'nt work.Here is my coding.
private sub form_load(...)
dim y as integer
y=me.height
location.y = 0-y

What is 'location'? Do you want to change the location of the Form?
In this place (ie) location.y is showing me a design error
itself.I actually wanted to use e.y but its not
recognizing in any object (ie) if I give (e.) then its not
showing me the contents whereas in form_mousemove alone
e.y is being shown.

What do you expect e.y to be in form_load?
Iam really waiting desperately for the full coding in
form_load (ie)I want to draw a line keeping my staring
cordinate in the bottom-left of the form.

Please .... provide me the coding.
Last time I got the reply like this y=maxheight-y
This didnt work out.
e.y signifies y coordintes
e.x signifies x coordinates.
if i give y = maxheight-y then I need to declare y but
practically not possible.

Sorry, I still don't understand the problem.
 
B

Brian

You'll have to do your own conversion to change the coordinates. Here's an
example:

Private Function MyConversion(ByVal temp As Point) As Point
Return New Point(temp.X, Me.ClientSize.Height - temp.Y)
End Function


Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

Dim pt As Point = New Point(10, 10)
Dim pt2 As Point = New Point(50, 100)
e.Graphics.DrawLine(Pens.Black, pt, pt2)
e.Graphics.DrawLine(Pens.Black, MyConversion(pt), MyConversion(pt2))

End Sub
 
R

Rob Teixeira [MVP]

private sub form_load(...)
dim y as integer
y=me.height
location.y = 0-y

In addition to all the other comments, the formula is (Y = Height - Y), not
(Y = Y- Height) , which is what your code is doing here.

-Rob Teixeira [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

reply didnt work out 4
change coordinates of form 4
changing coordinate of form 1

Top