Set Floating Document Window Size and Title

4 posts, 0 answers
  1. Susan
    Susan avatar
    8 posts
    Member since:
    Jun 2014

    Posted 29 Sep 2017 Link to this post

    How do you resize a document window when it is changed to floating.  Also, how do you change the title bar text?  I am using the FloatingWindowCreated event.  I have the statements listed below included already and they are working.  Nothing I have tried has worked for setting the size and title text.

          e.Window.AutoSize = True
          e.Window.ThemeName = myThemeName
          e.Window.MaximizeBox = True
          e.Window.MinimizeBox = True
          e.Window.Icon = My.Resources.TMBIcon

  2. Susan
    Susan avatar
    8 posts
    Member since:
    Jun 2014

    Posted 29 Sep 2017 in reply to Susan Link to this post

    Needed to add:  Using e.window.minimumsize new size(400,600)  does work to set the minimum size; however, I want the window to open at (400,600) but be allowed to be sized down.
  3. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3530 posts

    Posted 02 Oct 2017 Link to this post

    Hello, Susan, 

    Thank you for writing.  
     
    The floating window is a derivative of RadForm. In the FloatingWindowCreated event, you can subscribe to the Shown event where you can specify the desired title and size. Here is a sample code snippet:
    Sub New()
     
        InitializeComponent()
     
        AddHandler Me.RadDock1.FloatingWindowCreated, AddressOf FloatingWindowCreated
    End Sub
     
    Private Sub FloatingWindowCreated(sender As Object, e As Telerik.WinControls.UI.Docking.FloatingWindowEventArgs)
        RemoveHandler e.Window.Shown, AddressOf Window_Shown
        AddHandler e.Window.Shown, AddressOf Window_Shown
    End Sub
     
    Private Sub Window_Shown(sender As Object, e As EventArgs)
        Dim form As RadForm = TryCast(sender, RadForm)
        form.Text = "Sample title"
        form.Size = New Size(400, 600)
        form.Icon = My.Resources.WinFormsIcon
    End Sub


    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. Susan
    Susan avatar
    8 posts
    Member since:
    Jun 2014

    Posted 02 Oct 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Perfect!
Back to Top