Troy
Well-known member
- Joined
- Feb 7, 2005
- Messages
- 153
- Programming Experience
- 10+
VB.NET:
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] frmBrowser_FormClosed([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Object[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Windows.Forms.FormClosedEventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].FormClosed[/SIZE]
[SIZE=2][COLOR=#008000]'RemoveHandler Me.Enter, AddressOf frmBrowser_Enter[/COLOR][/SIZE]
[SIZE=2]nWindow = nWindow - 1[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] nWindow = 0 [/SIZE][SIZE=2][COLOR=#0000ff]And[/COLOR][/SIZE][SIZE=2] tbUpdatedFlag = [/SIZE][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[SIZE=2]ToolStripManager.RevertMerge([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].ParentForm.Controls([/SIZE][SIZE=2][COLOR=#a31515]"ToolStrip2"[/COLOR][/SIZE][SIZE=2]), ToolStrip1)[/SIZE]
[SIZE=2]tbUpdatedFlag = [/SIZE][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'MsgBox("There are " & nWindow & " windows open, and this is customer " & Me.Text & ", ID = " & Me.Tag)[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'AddHandler Me.Enter, AddressOf frmBrowser_Enter[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]
When I run my code it actually walks throught the process to revert the merge but it doesn't remove it?
Through debugging I watch it walk through and I open 3 children windows. As I close each window it skips the revert code as intended until nwindow = 0 then it walks throught the revert code like it should but my Toolstrip still has the child items merged after it closes the last child window.
and ideas?