Solved

location property on textbox control

Posted on 2011-02-10
9
265 Views
Last Modified: 2012-06-27
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



0
Comment
Question by:altariamx2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
9 Comments
 
LVL 10

Expert Comment

by:himanshut
ID: 34868093
0
 

Author Comment

by:altariamx2003
ID: 34868117
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"

0
 

Accepted Solution

by:
altariamx2003 earned 0 total points
ID: 34868148
this is the solution
---------------------------------------------------------------------
DIM NEW_POINT AS NEW SYSTEM.DRAWING.POINT(x,y)

IF TEXTBOX1.LOCATION = NEW_POINT THEN
 something....................
---------------------------------------------------------------------
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:himanshut
ID: 34868175
If( TextBox1.Location = System.Drawing.Point(X,Y))
{
 //code
}
else
{
 //code
}

Cheers!
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 34868282
You could also write it this way:
If TextBox1.Location.Equals(New Point(2, 2)) Then

Open in new window

0
 

Author Comment

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

0
 

Author Comment

by:altariamx2003
ID: 34868507
Idle_Mind

I cannot use your solution in my code

thanks any way
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 34868536
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
   
0
 

Author Closing Comment

by:altariamx2003
ID: 34895130
this works for my code
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question