Solved

location property on textbox control

Posted on 2011-02-10
9
261 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
  • 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
 
LVL 10

Expert Comment

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

Cheers!
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 85

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 85

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now