Container controls
-
Dear all, Can any one explain me what is the difference between container control and normal control Since both are derived from a Control class I am not able to differenciate them.please help me to find out the given control is container control or not. Have a nice day.
-
Dear all, Can any one explain me what is the difference between container control and normal control Since both are derived from a Control class I am not able to differenciate them.please help me to find out the given control is container control or not. Have a nice day.
Control container is example Panel in which we can set controls such is button,textbox,label,datetimepicker, etc.... Control is single one - example : button Control is single one - example : label Control is single one - example : textbox Control is single one - example : datetimepicker, etc....
-
Control container is example Panel in which we can set controls such is button,textbox,label,datetimepicker, etc.... Control is single one - example : button Control is single one - example : label Control is single one - example : textbox Control is single one - example : datetimepicker, etc....
thanks for your reference. How can I identify that the control is container control or not, at runtime. Contact him at: hasansheik@hotmail.com hasansheik@yahoo.co.in hasansheik@lycos.com
-
thanks for your reference. How can I identify that the control is container control or not, at runtime. Contact him at: hasansheik@hotmail.com hasansheik@yahoo.co.in hasansheik@lycos.com
hasansheik wrote:
How can I identify that the control is container control or not, at runtime.
Test the control against
System.Windows.Forms.ContainerControl
using theis
operator:System.Console.WriteLine(this is System.Windows.Forms.ContainerControl);
System.Console.WriteLine(label1 is System.Windows.Forms.ContainerControl);Where
this
is the form. The above two lines returntrue
andfalse
, respectively, sinceForm
is derived fromContainerControl
, andLabel
is not.ContainerControl
inherits fromScrollableControl
, which you can read about here[^]. Share and enjoy. Sean