Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

Toolbar problem

Hi all, I want to enable or disable toolbar buttons which is on the MDI parent form, on the basis of some event which is triggered when a button is pressed on the MDI child form, but when I do this it gives an error "ONLY ONE MDI FORM ALLOWED". How ccan avoid this problem.
Waiting for help...
0
Moin
Asked:
Moin
  • 2
1 Solution
 
lmorrisCommented:
This sounds like you created an instance of your MDI for by doing something like:

Dim f as MDIForm1
set f = new MDIForm1
f.Show

Then, later one of your MDI Child forms does a MDIForm1.Toolbar1.Buttons(0).Enable (for example).

You have one instance of the MDIForm1 (f), then you try to load another by refering to MDIForm1.

Instead of refering to your MDIForm as MDIForm1, try using parent.

Hope this was the problem or at least helps.
0
 
MoinAuthor Commented:
Yes, the problem was similar to this. Now I am using the name of the object, which is derived from the MDIMainFrm, instead of using the MDIForm directly.
Please mark your comment as answer so that I can grade it.
Thanx.
0
 
lmorrisCommented:
Glad I could help!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now