在C#中获取Windows窗体上元素的确切位置

编程入门 行业动态 更新时间:2024-10-13 00:33:34
本文介绍了在C#中获取Windows窗体上元素的确切位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

1)我正在尝试获取列表框项目的确切位置(x和y坐标) 是否有任何方法可用于检索Windows窗体上项目的确切位置 请告诉我... 我有2个列表框,其中包含项目 当我将一个项目从listbox1拖到listbox2时,我想在两个我无法做的项目之间画线 如果我得到拖放的项目的位置,则可能是可行的.

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

推荐答案

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

更多推荐

在C#中获取Windows窗体上元素的确切位置

本文发布于:2023-10-08 01:13:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1471078.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   确切   元素   位置   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!