467,101 Members | 1,144 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,101 developers. It's quick & easy.

Access form controls from Class in c#

i have a form namee Form1. and i have a class myclass.now what i need is i want to modify controls of Form1 from myclass. please notice that Controls in Form1 are runtime user controls. please help me for that. Thanx
Jul 31 '08 #1
  • viewed: 1368
Share:
3 Replies
8TB
You need a handle (reference) of that form in your class.
Classes shouldn't be allowed to change whatever they want anywhere.
Jul 31 '08 #2
just i need to access the controls on the form.so i need to first access that form.
Jul 31 '08 #3
8TB
just i need to access the controls on the form.so i need to first access that form.
The controls are properties/members of that form. You can't get to them unless you can get to the form. The only things you can get without having an instance are statics but then those do not belong to an instance either ...
Jul 31 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Peter Frost | last post: by
2 posts views Thread by paul meaney | last post: by
3 posts views Thread by Mr Newbie | last post: by
5 posts views Thread by c676228 | last post: by
4 posts views Thread by Boris Yeltsin | last post: by
14 posts views Thread by ApexData@gmail.com | last post: by
6 posts views Thread by Wesley Peace | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.