मैं करने के लिए चाहते हैं मूल रूप से खोजने के लिए एक नियंत्रण के स्थान के आधार पर नाम है. यह है कि क्या मैं इतनी दूर है:
private Point FindControlLocation(string ControlName, Control ParentControl)
{
//Code...
}
धन्यवाद किसी भी मदद के लिए!
मैं करने के लिए चाहते हैं मूल रूप से खोजने के लिए एक नियंत्रण के स्थान के आधार पर नाम है. यह है कि क्या मैं इतनी दूर है:
private Point FindControlLocation(string ControlName, Control ParentControl)
{
//Code...
}
धन्यवाद किसी भी मदद के लिए!
आप वास्तव में नहीं की जरूरत है, माता पिता के नियंत्रण, बस के फार्म का उपयोग करें और पुनरावर्ती विकल्प से Controls.Find()
:
private Point FindControlLocation(string ControlName)
{
Control ctl = this.Controls.Find(ControlName, true).FirstOrDefault() as Control;
return (ctl != null) ? ctl.Location : new Point();
}