Solved

location property on textbox control

Posted on 2011-02-10
9
266 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
 

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
Technology Partners: 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 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