.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

Regarding Retrieve the Controls

Posted By: subash     Posted Date: July 30, 2009    Points:2   Category :Windows Application
Hi,
How to retrieve the winform controls from another Form?
For Example i have winForm named as sample1,in which i want to write code for to retrieve controls of another form named as Sample2?
Is It Possible?

How to use control.controlcollection.find(formname)?

Thanks
Subash

Responses
Author: Faizal             
Posted Date: July 30, 2009     Points: 5   

Hi Subhash,
You can create the instance of the second form say Sample2 and using the object of the form you can get the control list

eg

Sample2 oSample = new Sample2();

oSample.Controls // this will give all the controls available in Sample2

Author: Santosh             
Posted Date: October 13, 2009     Points: 5   

Hi
Subhash
first u need to declare the second form(sample2) control as public and
after that u just create the object of sample2 and call sample2 form's control through the object

Regards
Santosh



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend