This is a migrated thread and some comments may be shown as answers.

active forms + MDIParent

4 Answers 89 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
dp
Top achievements
Rank 1
dp asked on 17 Sep 2008, 09:45 PM
Hi
I use this control in a MDIParent....
How I can put in Start Menu the list of active MDIchildren forms?

In MenuStrip of .NET the code is:

Me

.WindowsMenu = New System.Windows.Forms.ToolStripMenuItem

Me.MenuStrip.MdiWindowListItem = Me.WindowsMenu

Then when a user open a new form the name of this form is added to the list (Me.WindowsMenu


Thank you




4 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 18 Sep 2008, 03:47 PM
Hi dp,

Thank you for writing.

RadRibbonBar's start menu has not support build in MDI windows menu. Nevertheless, you could easily implement it. Please, review the code-block below as example:
 
Private Sub AddMenuItems() 
    For Each form As Form In Me.MdiChildren 
        Dim radMenuItem As New RadMenuItem(form.Text) 
        AddHandler radMenuItem.Click, AddressOf radMenuItem_Click 
        Me.radRibbonBar1.StartMenuRightColumnItems.Add(radMenuItem) 
    Next 
End Sub 
 
Private Sub radMenuItem_Click(ByVal sender As ObjectByVal e As EventArgs) 
    Dim item As RadMenuItem = TryCast(sender, RadMenuItem) 
    For i As Integer = 0 To Me.MdiChildren.Length - 1 
         
        If Me.MdiChildren(i).Text = item.Text Then 
            Me.MdiChildren(i).Focus() 
            Exit For 
        End If 
    Next 
End Sub 
 
 
 
Greetings,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
dp
Top achievements
Rank 1
answered on 19 Sep 2008, 02:59 AM
Firstly thanks for your quick reply, was very helpful.

Secondly...help me with this

How I can change the backColor of a RadMenuItem? because the below code don`t work:

Dim radMenuItemPrincipal As New RadMenuItem

radMenuItemPrincipal.BackColor = Color.Black


Thank you

0
Accepted
Martin Vasilev
Telerik team
answered on 19 Sep 2008, 04:17 PM
Hello dp,

Thank you for getting back to me.

You could change background color of RadMenuItem by changing background colors of its FillPrimitive element. Please, take a look at code-block below:
 
TryCast(radMenuItem.Children(0), FillPrimitive).BackColor = Color.Red 
TryCast(radMenuItem.Children(0), FillPrimitive).GradientStyle = Telerik.WinControls.GradientStyles.Solid 
TryCast(radMenuItem.Children(0), FillPrimitive).NumberOfColors = 1 

If you have other questions, do not hesitate to contact me again.
 

All the best,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
dp
Top achievements
Rank 1
answered on 25 Sep 2008, 11:58 PM
Thank you Martin Vasilev, 
greetings
Tags
RibbonBar
Asked by
dp
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
dp
Top achievements
Rank 1
Share this question
or