Simulating Clicking on New/Edit buttons on MFTS


Author
Message
Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
Your suggestion worked fine.  Smile

Thanks

Tim

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yeah, and this actually won't work correctly when the form is loading due to the initialization sequence.  All I would do is look at the FocusControlOnAdd or FocusControlOnEdit property and do this yourself.

If me.FocusControlOnAdd IsNot Nothing Then
     me.FocusControlOnAdd.Focus()
End If

You may need to do this in the Shown event of the form in order to make this work properly with the Focus().

Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
That's exactly what I'm doing, and it does seem to work, except for setting focus on the assigned control. I tried my code in a number of events, including the Form Load event.  Do you happen to know if there is an Form event that gets fired when all business objects and form stuff has been completed?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, all you really need to do is call the Edit() or Add() on the form and it will do the same thing as clicking the New or Edit on the MaintenanceFormToolstrip.  So just pass over your parm, and if it is add, then just call the Add() on the form and it will do the same thing as the MFToolstrip.
Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
In my form constructor I passing the initial editing state for the form. What event should I be adding my code to change the editing state based on my parameter, so it maintains the same functionality as clicking on New or Edit button.

Right now I have my code in the ParentFormLoading event of my primary business object. It does change the editing state correctly, but it will not honor the form properties 'FocusControlOnAdd and FocusControlOnEdit'. 

Thanks,

Tim

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search