Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enabling/Disable Toolstrip buttons
Message
From
04/03/2006 00:50:51
 
 
To
04/03/2006 00:13:01
General information
Forum:
ASP.NET
Category:
Web forms
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01101157
Message ID:
01101474
Views:
13
Steve,

I'm afraid you'll have to post your code. How are you calling the Wizard form? Is it a Dialog? How is the Wizard form referencing the Main form? If you want to reference controls on the Main form from the Wizard form, you'll need to pass a reference to the Main form to the Wizard's constructor. Maybe something like this:
// call the Wizard from Main (assume Wizard is a Dialog)
WizardForm oForm = new WizardForm(this);
oForm.ShowDialog();

// code for Wizard
public class WizardForm : MyBaseForm
{
    private oFormMain;

    public WizardForm(MainForm oMain)
    {
        this.oFormMain = oMain;
    }

    ....

    // in the Load event handler:
    this.oFormMain.next_ToolStripButton.Enable = false;
}
Hope this helps.

~~Bonnie



>Hi Bonnie & Perry,
>
>Thanks for your reply, and sorry for posting in the worng category. Well, I did what both you said by changing the modifier from private to public for the next button and I got a new error messages. More assistant is needed and much appreciated.
>
>Steve.
>
>These are the errors.
>
>Error 2 An object reference is required for the nonstatic field, method, or property 'MyApp.Main.next_ToolStripButton' C:\Documents and Settings\Steve\My Documents\Visual Studio 2005\Projects\MyApp\New_Reports\Wizard.cs
>
>Error 3 'System.Windows.Forms.ToolStripButton' does not contain a definition for 'enabled' C:\Documents and Settings\Steve\My Documents\Visual Studio 2005\Projects\MyApp\New_Reports\Wizard.cs
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform