In this case, we add a ToolWindow directly to the control in a floating state using FloatingWindow. Each add ToolWindow will have a different BackColor property value. Now we save the layout of the control into an XML file. The next step is to close the application and load the layout from the XML. The ToolWindows are loaded, however, their BackColor property is not restored.
this.toolWindow1.TabStrip.MinimumSize = new Size(200,200)
this.radDock1.DockTabStripNeeded += this.RadDock1_DockTabStripNeeded;
private void RadDock1_DockTabStripNeeded(object sender, DockTabStripNeededEventArgs e)
{
if (e.DockType == DockType.ToolWindow)
{
e.Strip = new MyToolTabStrip();
}
else
{
e.Strip = new MyDocumentTabStrip();
}
}
public class MyToolTabStrip : ToolTabStrip
{
protected override bool ScaleChildren => false;
}
public class MyDocumentTabStrip : DocumentTabStrip
{
protected override bool ScaleChildren => false;
}
Use cases: 1. You have a MainDocumentContainer with Document windows in it, placed in one under the other. Setting the DockState of the bottom DocumentWindow to Hidden, and restoring it afterwards, should place the DocumentWindow at the same place, instead of merging it with the above one 2. Same layout as above, when the layout is saved and then restored, the DocumentWindow positions should be exactly as they were
Use the following code snippet:
ToolTabStrip tabStrip = this.toolWindow1.TabStrip as ToolTabStrip;
this.toolWindow1.Text = "<html><span style=\"font-family:Segoe UI;font-size:8.25;\"><b>Hello</b></span><span" +
" style=\"font-family:Segoe UI;font-size:8.25;\">Woooooooooooooooooorld</span></html>";
TextPrimitive text = tabStrip.CaptionElement.FindDescendant<TextPrimitive>();
text.ClipDrawing = true;
text.StretchHorizontally = false;
text.DisableHTMLRendering = false;
text.AutoEllipsis = false;
To reproduce: See attached video. Workaround: public Form1() { RadDockEvents.TabStripItemCreating += RadDockEvents_TabStripItemCreating; InitializeComponent(); radDock1.AutoHideAnimation = Telerik.WinControls.UI.Docking.AutoHideAnimateMode.None; } void RadDockEvents_TabStripItemCreating(object sender, TabStripItemCreatingEventArgs args) { if (args.AutoHide) { var currentScale = args.TabItem.DpiScaleFactor; Screen showScreen = Screen.FromControl(this); SizeF scale = NativeMethods.GetMonitorDpi(showScreen, NativeMethods.DpiType.Effective); if (scale != currentScale) { var font = args.TabItem.Font; var newFont = new Font(font.Name, font.Size * scale.Width, font.Style); args.TabItem.Font = newFont; } } } protected override void OnClosed(EventArgs e) { RadDockEvents.TabStripItemCreating -= RadDockEvents_TabStripItemCreating; base.OnClosed(e); }
To reproduce:
1. Create a floating window
2. Try to drop another window into the floating window
3. The window is successfully docked into the floating window, but DockStateChanged event does not fire.
To reproduce: please run the attached sample project and follow the steps in the gif file. After some further testing you will notice that the tab items are re-positioned incorrectly when you click a certain tab. It jumps to another location. Workaround: set the MultiLineItemFitMode property to None and specify the DocumentWindow.TabStripItem.Row property in order to arrange the tabs as you wish.
To reproduce: run the application. On the first DocumentWindow there is a UserControl with a wizard. Pressing the Tab key will navigate the command buttons. On the second DocumentWindow there is a similar wizard which is NOT hosted in a UserControl. Workaround: Currently, you can override the ProcessDialogKey method of RadWizard and handle the Tab key where you can perform the desired logic, e.g. select a specific control: public class MyWizard : RadWizard { protected override bool ProcessDialogKey(Keys keyData) { if (keyData == Keys.Tab) { WizardPage page = this.SelectedPage; page.ContentArea.Controls[0].Focus(); return false; } return base.ProcessDialogKey(keyData); } }
Please use attached project and try the following: 1. Run the application and move toolWindow3 from right to the bottom panel. 2. Hide toolWindow3 by 'Toggle' menu item or just close it. 3. Save the layout pressing 'Save' menu item. 4. Close the application and run it again. 5. Restore layout using 'Init' menu item. 6. Press 'Toggle' menu item to show toolWindow3. Workaround: Make the window visible before loading the layout.
If you drag a regular form to the top of the screen it will be maximized. This should work with the floating window as well.
The attached videos demonstrate the present behavior and the desired one How to reproduce: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radDock1.EnableFloatingWindowSnapping = true; DragDropService svc = this.radDock1.GetService<DragDropService>(); svc.DragDropMode = DragDropMode.Preview; } }
This property should be inherited by all tool, document, floating and autohide windows.
To reproduce: Open the attached project and press Ctrl+ Tab in the first text box. Since the textboxes are accepting the Tab, Ctrl + Tab should move to the other control. Workaround // RadTextBox private void TextBoxItem_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if ((e.KeyData & Keys.Tab) == Keys.Tab && (e.KeyData & Keys.Control) == Keys.Control) { e.IsInputKey = true; var item = sender as RadTextBoxItem; this.SelectNextControl(item.HostedControl, true, true, true, true); } } //RadTextBoxControl private void RadTextBoxControl1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if ((e.KeyData & Keys.Tab) == Keys.Tab && (e.KeyData & Keys.Control) == Keys.Control) { e.IsInputKey = true; this.SelectNextControl(sender as RadTextBoxControl, true, true, true, true); } }