Link to home
Create AccountLog in
Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on

location property on textbox control

I would like to use this sentence

for example:
                    "IF TEXTBOX1.LOCATION = (2,2) THEN"

I know that the sintaxis is not right,

I would like to know how to use the location property in a IF STATEMENT



Avatar of himanshut
himanshut
Flag of Australia image

Avatar of altariamx2003

ASKER

hi himanshut

This is what I need to know to do.

"IF TEXTBOX1.LOCATION = POINT(X,Y) THEN"

I cannot use "IF TEXTBOX1.LOCATION.X=x AND TEXTBOX1.LOCATION.Y=y THEN"

ASKER CERTIFIED SOLUTION
Avatar of altariamx2003
altariamx2003
Flag of Mexico image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
If( TextBox1.Location = System.Drawing.Point(X,Y))
{
 //code
}
else
{
 //code
}

Cheers!
Avatar of Mike Tomlinson
You could also write it this way:
If TextBox1.Location.Equals(New Point(2, 2)) Then

Open in new window

himanshut that doesnt work, show the following error: "Point is a drawing type, and it cannot use as an expression

Idle_Mind

I cannot use your solution in my code

thanks any way
No problem...just FYI, you can use Equals() in your example too:

    Dim NEW_POINT As New System.Drawing.Point(x, y)
    If TextBox1.Location.Equals(NEW_POINT) Then
   
this works for my code