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

5 posts, 0 answers
  1. bradley baker
    bradley baker avatar
    97 posts
    Member since:
    Aug 2009

    Posted 25 Feb 2010 Link to this post

    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.
  2. bradley baker
    bradley baker avatar
    97 posts
    Member since:
    Aug 2009

    Posted 26 Feb 2010 Link to this post

    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 
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 03 Mar 2010 Link to this post

    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.
  5. bradley baker
    bradley baker avatar
    97 posts
    Member since:
    Aug 2009

    Posted 03 Mar 2010 Link to this post

    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?
  6. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 08 Mar 2010 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready