Icon for docked form

2 posts, 1 answers
  1. bhogavalli
    bhogavalli avatar
    28 posts
    Member since:
    Sep 2010

    Posted 02 Nov 2010 Link to this post

    Hi team,

    I have normal windows form which is docked using raddock.
    I need to set an icon on the tab of the form.

    Thanks
    Suresh.
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 02 Nov 2010 Link to this post

    Hi, 

    If you want to set an icon on the tab of a DockWindow when using RadDock and adding in forms as MDI Children, then this should work for you. (this is using the current latest release of Q2 2010 914)

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
     
        ' Has a distinct icon
        Dim form As New RadForm1()
        form.MdiParent = Me
        form.Show()
     
        ' Also has a distinct icon
        Dim form2 As New RadForm2()
        form2.MdiParent = Me
        form2.Show()
    End Sub
     
    Private Sub RadDock1_DockWindowAdded(ByVal sender As System.Object, _
        ByVal e As Telerik.WinControls.UI.Docking.DockWindowEventArgs) Handles RadDock1.DockWindowAdded
     
        Dim formIcon As New Icon(DirectCast(e.DockWindow.ActiveControl, Telerik.WinControls.UI.RadForm).Icon, 16, 16)
        e.DockWindow.Image = formIcon.ToBitmap()
    End Sub

    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top