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

Set Floating Document Window Size and Title

3 Answers 141 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Susan
Top achievements
Rank 1
Susan asked on 29 Sep 2017, 07:41 PM

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

3 Answers, 1 is accepted

Sort by
0
Susan
Top achievements
Rank 1
answered on 29 Sep 2017, 07:46 PM
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.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Oct 2017, 09:40 AM
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.
0
Susan
Top achievements
Rank 1
answered on 02 Oct 2017, 12:32 PM
Perfect!
Tags
GridView
Asked by
Susan
Top achievements
Rank 1
Answers by
Susan
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or