Solved

Determining Sending Form

Posted on 2006-11-27
2
184 Views
Last Modified: 2010-04-16
I have a form [frmNotes] that is called via different forms in my Windows Application.  Depending on which form calls it, I want the title of frmNotes to change and also I have a few different controls that I want to set as visible depending on the form which called it. For example:

if frmMain calls frmNotes:
    frmNotes.Text = "General Notes"
    button1.Visible = True

if frmSub calls frmNotes:
   frmNotes.Text = "Sub Notes"
   button2.Visible = True

I am not sure how to determine which form has called the frmNotes.

Thanks for the help.
0
Comment
Question by:sneeri_c
  • 2
2 Comments
 
LVL 15

Accepted Solution

by:
ozymandias earned 150 total points
ID: 18022138
In your form create an overload for for the Show() method that takes a form as an argument.

public void Show(Form caller){
    //check who the caller is and set you text and button visibility accordingly
    // then call show.
    this.Show();
}
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 18022146
Or create a constructor that does the same thing...
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now