Or you could make the TMenuItem invisible.

AcctRepMenuItem.Visible := False;

--- Aaron Scott-Boddendijk <[EMAIL PROTECTED]> wrote:
> > The conditional bit provides for a menuitem which opens a TNotebook
> > page, report start and finish dates etc are set.  A Run button
> > (AcctRepBtn) then calls a quick report.
> > This all works fine until I try to put these bits inside some
> > conditional compiler codes.
> > In a UserSettings unit I define {$DEFINE AcctRep}
> > In the Mainform I have a {$IFDEF AcctRep} and {$ENDIF} around both
> the
> > procedure declarations and those procedures in the Implementation
> part.
> > What I get - on compilation is "Exception EreadError.  Error
> reading
> > AcctRepBtn.Onclick:Invalid Property.
> 
> Unfortunately you can't place a conditional around the bit in the DFM
> file that
> refers to that Procedure.  Rather than using the conditional to
> remove the existence
> of the procedure entirely, simply remove the contents of the
> procedure
> 
>     {$IFNDEF OPT_NUKEIT} procedure MyCompletelyNukedProc; {$ENDIF}
>     procedure MySlightlyLessNukedProc;
> 
> implementation
> 
> {$IFNDEF OPT_NUKEIT}
> procedure MyCompletelyNukedProc;
> begin
>   // Blah
> end;
> {$ENDIF}
> 
> procedure MySlightlyLessNukedProc;
> begin
> {$IFNDEF OPT_NUKEIT}
>   // Blah
> {$ENDIF}
> end;
> 
> --
> Aaron Scott-Boddendijk
> Jump Productions
> (07) 838-3371 Voice
> (07) 838-3372 Fax
> 
> 
>
---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> 
> 

===
-- Systems Engineer, Inprise NZ. [EMAIL PROTECTED]
_______________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com.au address at http://mail.yahoo.com.au
or your free @yahoo.co.nz address at http://mail.yahoo.co.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to