Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New two New buttons
Message
 
To
07/07/2006 08:04:01
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01133963
Message ID:
01134559
Views:
25
Tony,

>When I click the button on page 1, it goes to page 2, clears all the fields, and populates the form with the default values. There is no binding source set. It just works.
>
>When I drop a mmButtonNew on page 2, run the form, go to page 3, click on the New button, the fields are _not_ cleared and the default values are _not_ set in the fields. The only thing it does is set the cursor into the field I set it for.

Is your form a subclass of mmMaintenanceForm? If so, the following should work. I just tried this in the MM .NET sample app and it works great:

1. Add the button to your form

2. Set its BindingFlag property to false (this prevents default New button behavior from kicking in)

3. With the New button selected, go to the Properties Window, and click the lightning bolt to see the list of events

4. Select the Click event and open its associated combo box. You should see btnNew_Click in the list. Select this handler method

Now both buttons will run the same code. If you DON'T see btnNew_Click in the list, are you using VB .NET or C#? VB .NET has a bug when it comes to registering handlers inherited from parent forms. If this is the case, you need to manually wire up btnNew_Click method handler with your second New button.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform