active forms + MDIParent

5 posts, 1 answers
  1. dp
    dp avatar
    3 posts
    Member since:
    Sep 2008

    Posted 17 Sep 2008 Link to this post

    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




  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 18 Sep 2008 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. dp
    dp avatar
    3 posts
    Member since:
    Sep 2008

    Posted 18 Sep 2008 Link to this post

    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

  5. Answer
    Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 19 Sep 2008 Link to this post

    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.
  6. dp
    dp avatar
    3 posts
    Member since:
    Sep 2008

    Posted 25 Sep 2008 Link to this post

    Thank you Martin Vasilev, 
    greetings
Back to Top
UI for WinForms is Visual Studio 2017 Ready