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

DockPosition.Fill = Invalid DockTabStrip for a DockPosition.Fill operation.

4 Answers 203 Views
Dock
This is a migrated thread and some comments may be shown as answers.
bradley baker
Top achievements
Rank 1
bradley baker asked on 25 Feb 2010, 10:36 PM
Trying to have a RadImageButton open a new form in a dock (Full mode not left/right/top/bottom)

    Private Sub RadImageButtonElement1_Click(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles RadImageButtonElement1.Click  
        Form1.Close()  
        Me.RadDock1.DockControl(Form1, DockPosition.Fill)  
        Form1.Show()  
    End Sub 

If I change it to .Left it will work fine, but I want it to be Fill.  Also how do I check to see if the form/window is open so it doesnt keep openiing the window like the above code does.

4 Answers, 1 is accepted

Sort by
0
bradley baker
Top achievements
Rank 1
answered on 26 Feb 2010, 05:25 PM
Okay I used MDI insted and it fixed the issue.  But how do I make it so when another form is opened that tab becomes the focus?

    Private ExpediteWindow As Boolean = False 
    Private HistoryWindow As Boolean = False 
 
    Private Sub RadImageButtonElement1_Click(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles RadImageButtonElement1.Click  
        If ExpediteWindow Then 
            Return 
        End If 
        ExpediteWindow = True 
        Form1.Text = "Expedite" 
        Form1.MdiParent = Me 
        Form1.Show()  
        AddHandler Form1.Disposed, AddressOf ExpediteWindowClose  
    End Sub 
 
    Private Sub ExpediteWindowClose(ByVal sender As ObjectByVal e As System.EventArgs)  
        ExpediteWindow = False 
    End Sub 
0
Nikolay
Telerik team
answered on 03 Mar 2010, 01:06 PM
Hi bradley baker,

The answer to your first question is contained in the following article: Creating a RadDock at Runtime.

As to your second question, you can activate a window by its MDI form, when another form is shown, by using ActivateMdiChild method on DockWindowAdded:
Private f As Form2 = Nothing
Private form2Added As Boolean = False
  
Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
    If form2Added Then
        Return
    End If
    f = New Form2()
    f.BackColor = Color.Red
    f.MdiParent = Me
    f.Show()
    form2Added = True
End Sub
  
Private Sub radDock1_DockWindowAdded(ByVal sender As Object, ByVal e As DockWindowEventArgs) Handles RadDock1.DockWindowAdded
    Me.radDock1.ActivateMdiChild(f)
End Sub

If you have additional questions, feel free to contact me.

All the best,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
bradley baker
Top achievements
Rank 1
answered on 03 Mar 2010, 04:04 PM
In this example wont this only activate 1 form?  I have lots of forms.  Is there a way to just have it activate whatever form was last docked?
0
Nikolay
Telerik team
answered on 08 Mar 2010, 01:46 PM
Hi bradley baker,

Thank you for the clarification. In order to activate each new window/form, please refer to the following code snippet:
Private Sub radDock1_DockWindowAdded(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.Docking.DockWindowEventArgs)
    Me.radDock1.ActivateWindow(e.DockWindow)
End Sub

If you have additional questions, feel free to contact me.

All the best,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Dock
Asked by
bradley baker
Top achievements
Rank 1
Answers by
bradley baker
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or