TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
arthur sandos
NA
2
6.7k
Access main form control from instance of new class
Aug 10 2010 7:53 AM
Hi, I have a form MainWindow and it populates a tab control with instances of mytab class.
mytab has a datagrid and when selections are made I need to change the contents of a label on the main form (lblInfo).
I have no problem getting the data to a variable but I can't find a way to access the labels properties to display my info from inside the code for mytab class.
How can I access this labels properties from the new class?
in vb6 I think it would have worked to write MainWindow.lblInfo = "whatever" but that doesn't work.
I tried initiating the main form as
public mainwin = new MainWindow
mainwin.show
then in the class go for mainwin.lblInfo
but this says mainwin is not declared. it may be inaccessible due to its protection level.
I feel like there is a concept I'm missing here. Any help appreciated. Thanks.
Reply
Answers (
1
)
Vb.net coding with WPF application Video Tutorials.
Media Element in WPF Application is not playing any sound and is not even giving any exception?