473,396 Members | 1,766 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,396 software developers and data experts.

change in coordinates in form

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
Nov 20 '05 #1
4 2138
* "K.N.Ranjit" <kn******@rediffmail.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
"K.N.Ranjit" <kn******@rediffmail.com> schrieb
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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
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

"K.N.Ranjit" <kn******@rediffmail.com> wrote in message
news:05****************************@phx.gbl...
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

Nov 20 '05 #4
> 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]
Nov 20 '05 #5

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

Similar topics

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...
7
by: dotnetnoob | last post by:
i keep getting Object references not set to an instance of an object from this code: Private Sub EqBinding() Dim x As Integer x = 0 Do If CStr(arlsType.Item(x)) = "Bacnet Point" Then Dim...
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...
2
by: laredotornado | last post by:
Hi, I'm using php 4.4.4. Maybe I'm misreading the docs, but in the imagettfbbox manual (http://us2.php.net/imagettfbbox), it says that text coordinates are the same regardless of what the angle...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.