Displaying multiple forms

N

Nancy Kafer

I am trying to integrate the FormStack code into my VB .NET 2003 application
so that I can handle displaying multiple forms. I have copied the code from
the IStackable application into my project. When I run the application my
main form displays perfectly. However, when I press the button to navigate
to one of my other forms my form doesn't display. I have played with
different events but nothing seems to work. I also verified that the
IStackable code is implemented in my second form. When testing I discovered
that if I used a menu item my form was displayed properly however, when I
put the same code on the "Button" click method my form won't display.

One other piece of information: I am using form inheritance for my forms in
the application. However, I removed the form inheritance code and I'm still
having the problem.

Why won't any form except my main form display?

Thanks.
 
G

Guest

You might try a call to BringToFront or SetWindowPos is the Push and Pop
methods when they display the top Form in the stack.

-Chris
 
N

Nancy Kafer

But part of the problem is that the "button click" event isn't firing.
I've set debug points in my code that correspond to the click event of
the button but it never executes that code. When I set break points on
the menu item the code executes just fine. I've even created a new form
with one button on it and it still doesn't work.

The sample I copied from uses buttons so I'm not sure why my buttons
aren't working.
 
A

Arun

Hi Nancy,

Check whether the EventHandler is declared for button1_Click event in
InitializeComponent(), if not declared double click on the button to
create the event handler and have your break point and check.
or even if the EventHandler is declared sometimes you may need to
create it again and check.

Hope this helps,
Cheers,
Arun.
www.innasite.com
 
D

Daniel Moth

The OP is using VB; there will be nothing in the InitializeComponent.

Check for Handles keyword after the button1_click method instead.

Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top