I dynamically generate a Windows Forms form by reading an XML file. (Actually, I have a separate tool designed to serialize a Windows Forms form and its components.)
How do I know in which container each control is managed?
For example, if I dynamically create a label that I want to find if it is inside a group field or any container. Is there any property available for this?
It will be mycontrol.Parent.
mycontrol.Parent
Take a look
Property Control.Parent
.NET controls have a property called Parent. The controls inside the group pane are set as the parent name as the group name.
Firstly, you can find the group field, for example, for example:
groupbox x
After that, find the label, for example
(Label) x.findControl("labelID").
You can try this as follows.
Source: https://habr.com/ru/post/1780823/More articles:EXEC_BAD_ACCESS in a two-line OpenGL program - initializationMaintaining an order when choosing a static group from a table - c #How to adjust DevExpress TcxGrid size - delphiJavaScript regular expression (checking page range) - javascriptThe embarrassment of creating an application that has a version for iphone and iPad - iosSelect the nth child in xQuery / select the next item - selectHow to store attribute values โโof various types as EAV? - database-designmalloc calls SIGSEGV: segmentation error - cHow to use url as file name to upload? - urlMVC when developing in objective-C without using Interface Builder - design-patternsAll Articles