ShowDialog issues

R

Richard Kucia

I've run into some problems with ShowDialog. Try this:

Create 2 forms, Form1 and Form2.
In Form1:

* Add a MainMenu
* Add a Button named Button1; set its Text = "Form2.ShowDialog"
* Set MinimizeBox=False
* Include this code:

Dim F2 As Form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
F2.ShowDialog()
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
F2 = New Form2
End Sub

In Form2:

* Add a MainMenu
* Add an ImageList; place any icon in the ImageList
* Add a Toolbar; set the ToolBar's ImageList to the one just added
* Add a ToolBarButton; set its ImageIndex to 0

When you run the application, the toolbar from Form2 shows up on ***Form1*** when Form1 is initially shown. After displaying Form2 once, the toolbar no longer appears on Form1.

Richard Kucia
 
K

Katie Schaeffer [MSFT]

Hello Richard,

This is a known bug. For a workaround, try re-assigning Form1's MainMenu
after the creation of Form2. Let me know if you're still blocked.

Thanks,
-Katie

--------------------
| From: "Richard Kucia" <[email protected]>
| Subject: ShowDialog issues
| Date: Fri, 22 Aug 2003 13:02:55 -0400
| Lines: 110
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_009A_01C368AD.B424FE20"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: 90.cleveland-11-12rs.oh.dial-access.att.net
12.87.132.90
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:31737
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I've run into some problems with ShowDialog. Try this:
| Create 2 forms, Form1 and Form2.
| In Form1:
| * Add a MainMenu
| * Add a Button named Button1; set its Text = "Form2.ShowDialog"
| * Set MinimizeBox=False
| * Include this code:
| Dim F2 As Form2
| Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
| F2.ShowDialog()
| End Sub
| Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
| F2 = New Form2
| End Sub
| In Form2:
| * Add a MainMenu
| * Add an ImageList; place any icon in the ImageList
| * Add a Toolbar; set the ToolBar's ImageList to the one just added
| * Add a ToolBarButton; set its ImageIndex to 0
| When you run the application, the toolbar from Form2 shows up on
***Form1*** when Form1 is initially shown. After displaying Form2 once, the
toolbar no longer appears on Form1.
| Richard Kucia
|

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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