Solved

Determining Sending Form

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to read json value 2 50
Reset asp.net login password 4 42
insert value of checklistbox checked 4 27
VB.NET 2008 Winforms Signing 13 19
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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