Form (tab) opens back

2 Answers 69 Views
Dock Form
agustin
Top achievements
Rank 1
Iron
Iron
agustin asked on 15 Oct 2022, 08:50 PM
       

 

 

Hi Telerik!

I use the following code to open a new form in a tab. however, when I want to open a different form in another new tab, it does not open with a focus, but rather, I have to click on that tab to see it

If gF_bFormAbierto("frmProd") = True Then
            MsgBox("frm is open")
        Else
            RadDock1.Visible = True

            Dim childForm As frmProductos = New frmProd()

            childForm.MdiParent = Me
            childForm.Show()
End If

 

image example: the one I mark with a red arrow is the new form that I opened

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Oct 2022, 01:17 PM

Hi, Agustin,

RadDock has the capability of automatically finding and attaching Multiple Document Interface (MDI) child forms as tabbed documents:

https://docs.telerik.com/devtools/winforms/controls/dock/mdi-mode/automatic-mdi-form-handling 

Thus, when a new form is shown, it is automatically activated:

Here is the sample code snippet I tested:

    Sub New()
         
        InitializeComponent()

        Me.IsMdiContainer = True
        Me.RadDock1.AutoDetectMdiChildren = True

    End Sub
    Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
        Dim childForm As New Form()
        childForm.Text = "MDI Child " & DateTime.Now.ToLongTimeString()
        childForm.MdiParent = Me
        childForm.Show()
    End Sub

I have also attached my sample project for your reference. Please give it a try and see how it works on your end.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
agustin
Top achievements
Rank 1
Iron
Iron
answered on 19 Oct 2022, 12:38 AM
well, try to use your project but it doesn't open the new tab in the background anyway...

I think it's because I'm opening forms inside these tabs but I'm not sure.

anyway there is some command to bring each tab to the front... let's say how to simulate what the click does, but from the code, it would be ideal to solve my problem
Dess | Tech Support Engineer, Principal
Telerik team
commented on 20 Oct 2022, 08:59 AM

Hi, Agustin, Note that RadDock offers the ActiveWindow property. This allows you to specify which DockWindow to be currently activated.
Tags
Dock Form
Asked by
agustin
Top achievements
Rank 1
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
agustin
Top achievements
Rank 1
Iron
Iron
Share this question
or