c# window title setting from arbitrary panel

Hi Experts,
I'm looking for something like AfxGetMainWnd in c# so that I can set the window title. I'm in a panel and this panel could be in another panel or in a child window, etc..... Is there a way to do this in c#?

Hi thready;
Because Application.OpenForms is a collection of all open forms in the application the first one in the collection may not be the one you want to change. so use this form to get a reference

Because Application.OpenForms is a collection of all open forms in the application the first one in the collection may not be the one you want to change. so use this form to get a reference to the correct window.

Oh, and just in case for some reason [0] doens't refer to your main form you can use this to change the title based on the type of form (assuming you only have one of your main form open at any time). If you have multiple of the same form, you can change getType() and typeof() and use Name == "your form name" to explicitly target a specific form you've made by name. If this were your main form though, its started in your program file and allocated without a name, you would have to save the name or explicitly name it and pass it in to use the name method.

Featured Post

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.

This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory.
NOTE: For Outlook 2016 and 2013 perform the exact same steps.
Open a new email: Click the New email button in Outlook.
Start typing the address: …