Passing events between forms

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Anonymouse (Anonymouse_at_discussions.microsoft.com)
Date: 10/05/04


Date: Tue, 5 Oct 2004 12:43:03 -0700

If I call a form as a result of selecting a menu option, is it possible for
the form to pick up on which option it was called from?

I have a form which can be used to enter data into 2 different tables
(Certificate and Category), and it has add/edit/delete buttons. I want the
form to be able to detect whether the user selected Certificate or Category
in the main menu, and alter the text on the buttons accordingly. I've worked
out a way to do it using a module to define a public variable; the variable
is set by the menu click events and the form can then test the variable and
set button text accordingly. It works, but I don't like it - I don't want to
use public variables, as you're supposed to keep everything as private as
possible. Is there an event raised which the form can detect in order to
determine which menu option as selected?



Relevant Pages

  • Re: Passing events between forms
    ... to the called form's consctructor. ... - Sahil Malik ... > If I call a form as a result of selecting a menu option, ... > use public variables, as you're supposed to keep everything as private as ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: choosing linestyles with a combobox
    ... I'm trying to let a user choose a linestyle by selecting one out of a combobox. ... private class LineCellRenderer extends JLabel implements ListCellRenderer { ...
    (comp.lang.java.gui)
  • Re: "Private" Distribution List
    ... Selecting the Private option doesn't change how the DL works. ... DL in the Bcc section. ... Putting the names in the BCC section accomplishes the privacy, ...
    (microsoft.public.outlook.general)
  • choosing linestyles with a combobox
    ... I'm trying to let a user choose a linestyle by selecting one out of a combobox. ... I try to display a preview line in each item of the combo. ... private class LineCellRenderer extends JLabel implements ListCellRenderer { ...
    (comp.lang.java.gui)