Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
1)I am trying to get the exact location(x and y coordinate) of a listboxitem

Is there any method that can be used to retrive the exact location of item on windows form
please tell me...
I have 2 listboxes which contains items in it
when i drag a item from listbox1 to listbox2 i want to draw line between two that draged and dropped item which i am unable to do
and can be possible if i get the position of dragged and dropped item
Posted
Updated 5-Nov-12 19:46pm
v2
Comments
Sergey Alexandrovich Kryukov 6-Nov-12 1:21am    
Why?!

I would say, if you really need its location, there is something wrong in your design. However, maybe if you explain, it turns out to be reasonable.

--SA
Sergey Alexandrovich Kryukov 6-Nov-12 1:24am    
Form?! Is it WPF or Forms? The class ListBoxItem is only in WPF, and it does have the position...
--SA
shreyaswonder1989 6-Nov-12 1:47am    
it is not a WPA it is a window application form
Sergey Alexandrovich Kryukov 6-Nov-12 1:48am    
OK, please, give me exact type of the item.
--SA
shreyaswonder1989 6-Nov-12 1:50am    
item will be from listbox which is of type string

1 solution

VB
if control id is txtbox
int x =txtbox.Location=Location.X //for x axis
int y=txtbox.Location=Location.Y //for y axis
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900