Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
Diptimaya Patra
Dhananjay Kumar
nishithraj
Kunal Chowdhury
Shashi Ray
Home
>>
Forum
>>
Windows Application
>>
Post New Question
Subscribe to Forum
About get all Controls in a form
Posted By :
subash
Posted Date :
26/06/2009
Points :
2
Category :
Windows Application
Hi,
I want to get the controls inside a tab page or group box which is in a windows forms in C#.
Ex:
foreach(Controls ctrl in tabPage1.controls)
{
if(ctrl is Label)
{
my code is here
}
}
Above code is the written by me for accesing Label Controls in my form.But i cant retreive Label Control Because it is inside the tabpage.
Is there any solution for this without specifying Groupbox1.Controls or tabpage1.controls
Plesae help me with the code
Thanks
Subash
Responses
Author:
Praveen
Company URL:
Posted Date: 26/06/2009 Points: 5
The Best way is have one Panel inside each tab area.
Now say you have panel1 inside Tab1 and in the Panel1 you have 10 controls
to retrieve all the label controls from Panel1
foreach (Control ctrl in Panel1.Controls)
{
Label lbl = ctrl as Label;
if (lbl != null)
{
// your logic goes here
}
}
Happy Coding!!!
Praveen
Post Reply
You must
Sign In
To post reply
Related Questions
Windows application Form Focus in C#.NET
Can we use Web form controls in window form of Windows application
Multiple controls selection in VS2008
Visual Studio .Net 2008, There are no controls in the toolbox???
How to fix a form unmovable within a specify panel
Latest Forum Questions From The Same Category
file upload to a particular location.
banding navigator + delete button+ items position
File extension validation in textbox in windows form,c#
child form size should auto fit with the parent form size
saving childs form changes from parent form(MDI-Form)
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Here
Quick Links For Forum Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
OOPs
Silverlight
IIS
JQuery
JavaScript/VBScript
Biztalk
WPF
Patten/Practices
WCF
Others
www.DotNetSpark.com
UnAnswered
All
Hall of Fame
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend