MdiWindowListItem


Author
Message
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hiya.

I am shamelessly trying to copy "someone's" idea of a MainForm.Tongue

My intention is to get rid of the MenuStrip and use the ThemedToolStrip instead. So far, so good. But now I got to the "Window" item, which will show the opened MDI windows list.

Now I would need to have a "Window" ToolStripDropDownButton to behave in the same way as the MenuStrip MdiWindowListItem. Would that be too difficult to implement?

Cheers.

Replies
Teddy Jensen
Teddy Jensen
StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)
Group: StrataFrame Users
Posts: 52, Visits: 8K
In case anyone wants a ToolStripDropDownButton instead of a windowslist in a sidepanel or on a menu you can use this approach.

On the toolstrip i have a button called tsbVinduer so my code on the main form is

Private Sub tsbVinduer_DropDownOpening(ByVal sender As Object, ByVal e As System.EventArgs) Handles tsbVinduer.DropDownOpening

 

        tsbVinduer.DropDownItems.Clear()

 

        For Each f As Form In Me.MdiChildren

 

            Dim item As ToolStripMenuItem = New ToolStripMenuItem(f.Text)

            item.Tag = f

 

            AddHandler item.Click, AddressOf item_Click

 

            tsbVinduer.DropDownItems.Add(item)

        Next

 

    End Sub

 

    Private Sub item_Click(ByVal sender As Object, ByVal e As EventArgs)

 

        Dim item As ToolStripItem = TryCast(sender, ToolStripItem)

        If item IsNot Nothing Then

            Dim f As Form = TryCast(item.Tag, Form)

            If f IsNot Nothing Then

                f.Activate()

            End If

        End If

    End Sub

It gives me this result:

/Teddy

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Teddy,

Thanks for sharing this approach, it definitely provide ideas on how to get similar results in different ways which is very good, specially when learning .NET.

Edhy Rijo

Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Just to add another option to this thread you can also handle the Mdi Client Control Added and Removed on your Main MDI Form.

#Region " MDI Client Handled Events"

Protected Sub MDIClient_ControlAdded(ByVal sender As Object, ByVal e As Windows.Forms.ControlEventArgs)

'--> Cast To My Base Class so we get custom properties

Dim loChild As Payroll.Base.WindowsForms.DevExMaintFormBase = CType(e.Control, System.Windows.Forms.Form)

' do anything you need to do -add handlers update custom lists etc

End Sub

Protected Sub MDIClient_ControlRemoved(ByVal sender As Object, ByVal e As Windows.Forms.ControlEventArgs)

'--> Cast To Base Class so we get custom properties

Dim loChild As Payroll.Base.WindowsForms.DevExMaintFormBase = CType(e.Control, System.Windows.Forms.Form)

' do anything you need to do - remove handlers update custom lists etc

End Sub

#End Region


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ivan George Borges - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Ivan George Borges - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Ivan George Borges - 19 Years Ago
                         [quote]You have put the Themed Containers in a docked form on the...
Trent L. Taylor - 19 Years Ago
                             Hey Trent, Nice, I have been attempting to do the same. Would be nice...
Michael Reese - 19 Years Ago
                                 Can't believe it, Trent ... I did it!!! It is even activating the...
Ivan George Borges - 19 Years Ago
                                     This form looks very familiar ... I just can't understand what it says...
Trent L. Taylor - 19 Years Ago
                                         Seriously...it looks great!
Trent L. Taylor - 19 Years Ago
Chan - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Michael Cobb - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Keith Gordijn - 17 Years Ago
Keith Gordijn - 17 Years Ago
                         That will work fine :)
Trent L. Taylor - 17 Years Ago
Michael Cobb - 18 Years Ago
             Glad it worked for you :)
Trent L. Taylor - 18 Years Ago
StarkMike - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Teddy Jensen - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Teddy Jensen - 18 Years Ago
Ivan George Borges - 18 Years Ago
Edhy Rijo - 17 Years Ago
StrataFrame Team - 17 Years Ago
                         [quote][b]Ben Chase (03/31/2008)[/b][hr]You'll need to store more than...
Edhy Rijo - 17 Years Ago
Chan - 17 Years Ago
Mike Tomlin - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Edhy Rijo - 17 Years Ago
Trent L. Taylor - 17 Years Ago
                         Oh....nevermind, you are using that older logic on the window handles...
Trent L. Taylor - 17 Years Ago
                             Since we no longer use this logic I hadn't noticed that Vista changes...
Trent L. Taylor - 17 Years Ago
                                 [quote][b]Trent L. Taylor (04/15/2008)[/b][hr] [codesnippet]For each f...
Edhy Rijo - 17 Years Ago
                                     You would be passing it into some method. If you look further up the...
Trent L. Taylor - 17 Years Ago
Teddy Jensen - 17 Years Ago
Edhy Rijo - 17 Years Ago
Paul Chase - 17 Years Ago
lastcanary - 15 Years Ago
Ivan George Borges - 15 Years Ago
Russell Scott Brown - 15 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search