Click here to Skip to main content
15,617,231 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am doing a database with my frontend as c# and backend as sql. i have 2 forms namely mainform and member. mainform is mdiparent and member is mdichild.
member contains a timer which is used to count the number of records from sql database.
i have want to display the text of the count on a toolstrip label on the mainform.
[no name] 7-Jun-15 19:09pm    
What have you tried?
What was the problem you had when you ran your code?
Did you debug your code?
Did you get any error messages?
Additionally it would be exactly the same way that you have already been told when you asked the same question previously,
MaximusDebois 7-Jun-15 19:46pm    
the code for timer_tick is
int MemberCount = 0;
MemberCount = memberBindingSource.Count;
tryCount1.Text = MemberCount + " Youth Service Members in iEMYS";
but instead of label trycount1 on the member form i want it to display on the toolstriplabel on the mainform

1 solution

The question of the form collaboration is pretty much empty, because right approach should start from understanding that forms classes and their instances are still classes and instances, so working with them makes no principle differences between forms and another other classes and objects. Nevertheless, the question turned out to be quite popular, so I wrote an article special for such cases: Many Questions Answered at Once — Collaboration between Windows Forms or WPF Windows[^].

I have no idea why did you decide to use a timer and how would you use it; but all things are done in a similar ways. I'll only note that it does not seem to make much sense. If you want to discuss it, you can comment on it or ask another question.

Finally, as to MDI, here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. Please see:,
How to Create MDI Parent Window in WPF?.

I can explain what to do instead. Please see my past answers:
How to Create MDI Parent Window in WPF?,
Question on using MDI windows in WPF,
MDIContainer giving error,
How to set child forms maximized, last childform minimized.

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900