Solved

Determining Sending Form

Posted on 2006-11-27
2
187 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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