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

Image and title issues in the ToolWindows and Documents (2009.2.729)

6 Answers 156 Views
Dock
This is a migrated thread and some comments may be shown as answers.
jpl
Top achievements
Rank 1
jpl asked on 19 Oct 2009, 09:50 AM
Hi,

I don't know why my last posts has been removed. There is an issue with titles and radDock. See the code below :

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Windows.Forms;  
using Telerik.WinControls.UI;  
using Telerik.WinControls.UI.Docking;  
 
namespace radDockTest  
{  
    static class Program  
    {  
        /// <summary> 
        /// Point d'entrĂ©e principal de l'application.  
        /// </summary> 
        [STAThread]  
        static void Main()  
        {  
            Application.EnableVisualStyles();  
            Application.SetCompatibleTextRenderingDefault(false);  
            Application.Run(new MainForm());  
        }  
    }  
 
    public class ChildForm : RadForm {  
 
        public void setContent(Control control) {  
            control.Dock = DockStyle.Fill;  
            Controls.Add(control);  
        }  
    }  
 
    public partial class MainForm : RadForm {  
 
        public MainForm() {  
            InitializeComponent();  
            IsMdiContainer = true;  
            radDock.AutoDetectMdiChildren = true;  
        }  
 
        private void radButton1_Click(object sender, EventArgs e) {  
            addChildForm("One", true);  
        }  
 
        private void radButton2_Click(object sender, EventArgs e) {  
            addChildForm("Two", false);  
 
        }  
 
        void addChildForm(string title, bool one) {  
            ChildForm child = new ChildForm();  
            child.setContent(one ? (Control)new UserControl1() : (Control)new UserControl2());  
            DockWindow dockWindow = radDock.DockControl(child, DockPosition.Fill, DockType.Document);  
            dockWindow.TabStripItem.Text = title;  
        }  
    }  
    partial class MainForm {  
        /// <summary> 
        /// Required designer variable.  
        /// </summary> 
        private System.ComponentModel.IContainer components = null;  
 
        /// <summary> 
        /// Clean up any resources being used.  
        /// </summary> 
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> 
        protected override void Dispose(bool disposing) {  
            if (disposing && (components != null)) {  
                components.Dispose();  
            }  
            base.Dispose(disposing);  
        }  
 
        private void InitializeComponent() {  
            this.radDock = new Telerik.WinControls.UI.Docking.RadDock();  
            this.documentContainer1 = new Telerik.WinControls.UI.Docking.DocumentContainer();  
            this.radPanel = new Telerik.WinControls.UI.RadPanel();  
            this.radButton1 = new Telerik.WinControls.UI.RadButton();  
            this.radButton2 = new Telerik.WinControls.UI.RadButton();  
            ((System.ComponentModel.ISupportInitialize)(this.radDock)).BeginInit();  
            this.radDock.SuspendLayout();  
            ((System.ComponentModel.ISupportInitialize)(this.documentContainer1)).BeginInit();  
            ((System.ComponentModel.ISupportInitialize)(this.radPanel)).BeginInit();  
            this.radPanel.SuspendLayout();  
            ((System.ComponentModel.ISupportInitialize)(this.radButton1)).BeginInit();  
            ((System.ComponentModel.ISupportInitialize)(this.radButton2)).BeginInit();  
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();  
            this.SuspendLayout();  
            //   
            // radDock  
            //   
            this.radDock.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(254)))));  
            this.radDock.Controls.Add(this.documentContainer1);  
            this.radDock.Dock = System.Windows.Forms.DockStyle.Fill;  
            this.radDock.DocumentManager.DocumentInsertOrder = Telerik.WinControls.UI.Docking.DockWindowInsertOrder.InFront;  
            this.radDock.Location = new System.Drawing.Point(0, 0);  
            thisthis.radDock.MainDocumentContainer = this.documentContainer1;  
            this.radDock.Name = "radDock";  
            this.radDock.Size = new System.Drawing.Size(284, 231);  
            this.radDock.TabIndex = 0;  
            this.radDock.TabStop = false;  
            this.radDock.Text = "radDock";  
            //   
            // documentContainer1  
            //   
            this.documentContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(254)))));  
            this.documentContainer1.Location = new System.Drawing.Point(0, 0);  
            this.documentContainer1.Name = "documentContainer1";  
            this.documentContainer1.Size = new System.Drawing.Size(284, 231);  
            this.documentContainer1.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Fill;  
            this.documentContainer1.TabIndex = 0;  
            this.documentContainer1.TabStop = false;  
            //   
            // radPanel  
            //   
            this.radPanel.Controls.Add(this.radButton2);  
            this.radPanel.Controls.Add(this.radButton1);  
            this.radPanel.Dock = System.Windows.Forms.DockStyle.Bottom;  
            this.radPanel.Location = new System.Drawing.Point(0, 201);  
            this.radPanel.Name = "radPanel";  
            this.radPanel.Size = new System.Drawing.Size(284, 30);  
            this.radPanel.TabIndex = 1;  
            //   
            // radButton1  
            //   
            this.radButton1.AllowShowFocusCues = true;  
            this.radButton1.Location = new System.Drawing.Point(3, 3);  
            this.radButton1.Name = "radButton1";  
            this.radButton1.Size = new System.Drawing.Size(75, 23);  
            this.radButton1.TabIndex = 0;  
            this.radButton1.Text = "Form1";  
            this.radButton1.Click += new System.EventHandler(this.radButton1_Click);  
            //   
            // radButton2  
            //   
            this.radButton2.AllowShowFocusCues = true;  
            this.radButton2.Location = new System.Drawing.Point(86, 4);  
            this.radButton2.Name = "radButton2";  
            this.radButton2.Size = new System.Drawing.Size(75, 23);  
            this.radButton2.TabIndex = 1;  
            this.radButton2.Text = "Form2";  
            this.radButton2.Click += new System.EventHandler(this.radButton2_Click);  
            //   
            // MainForm  
            //   
            this.ClientSize = new System.Drawing.Size(284, 231);  
            this.Controls.Add(this.radDock);  
            this.Controls.Add(this.radPanel);  
            this.Name = "MainForm";  
            //   
            //   
            //   
            this.RootElement.ApplyShapeToControl = true;  
            ((System.ComponentModel.ISupportInitialize)(this.radDock)).EndInit();  
            this.radDock.ResumeLayout(false);  
            ((System.ComponentModel.ISupportInitialize)(this.documentContainer1)).EndInit();  
            ((System.ComponentModel.ISupportInitialize)(this.radPanel)).EndInit();  
            this.radPanel.ResumeLayout(false);  
            ((System.ComponentModel.ISupportInitialize)(this.radButton1)).EndInit();  
            ((System.ComponentModel.ISupportInitialize)(this.radButton2)).EndInit();  
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();  
            this.ResumeLayout(false);  
 
        }  
 
        private Telerik.WinControls.UI.Docking.RadDock radDock;  
        private Telerik.WinControls.UI.Docking.DocumentContainer documentContainer1;  
        private Telerik.WinControls.UI.RadPanel radPanel;  
        private Telerik.WinControls.UI.RadButton radButton2;  
        private Telerik.WinControls.UI.RadButton radButton1;  
    }  
 
    public partial class UserControl1 : UserControl {  
        public UserControl1() {  
            InitializeComponent();  
        }  
    }  
    partial class UserControl1 {  
        /// <summary>   
        /// Variable nĂ©cessaire au concepteur.  
        /// </summary> 
        private System.ComponentModel.IContainer components = null;  
 
        /// <summary>   
        /// Nettoyage des ressources utilisĂ©es.  
        /// </summary> 
        /// <param name="disposing">true si les ressources managĂ©es doivent Ăªtre supprimĂ©es ; sinon, false.</param> 
        protected override void Dispose(bool disposing) {  
            if (disposing && (components != null)) {  
                components.Dispose();  
            }  
            base.Dispose(disposing);  
        }  
 
        #region Code gĂ©nĂ©rĂ© par le Concepteur de composants  
 
        /// <summary>   
        /// MĂ©thode requise pour la prise en charge du concepteur - ne modifiez pas   
        /// le contenu de cette mĂ©thode avec l'Ă©diteur de code.  
        /// </summary> 
        private void InitializeComponent() {  
            this.radLabel = new Telerik.WinControls.UI.RadLabel();  
            ((System.ComponentModel.ISupportInitialize)(this.radLabel)).BeginInit();  
            this.SuspendLayout();  
            //   
            // radLabel  
            //   
            this.radLabel.AutoSize = false;  
            this.radLabel.Dock = System.Windows.Forms.DockStyle.Fill;  
            this.radLabel.Location = new System.Drawing.Point(0, 0);  
            this.radLabel.Name = "radLabel";  
            //   
            //   
            //   
            this.radLabel.RootElement.StretchHorizontally = true;  
            this.radLabel.RootElement.StretchVertically = true;  
            this.radLabel.Size = new System.Drawing.Size(150, 150);  
            this.radLabel.TabIndex = 0;  
            this.radLabel.Text = "Dock me elsewhere and the title will change. Please tell me how to keep the initi" +  
                "al one.";  
            //   
            // UserControl1  
            //   
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);  
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;  
            this.Controls.Add(this.radLabel);  
            this.Name = "UserControl1";  
            ((System.ComponentModel.ISupportInitialize)(this.radLabel)).EndInit();  
            this.ResumeLayout(false);  
 
        }  
 
        #endregion  
 
        private Telerik.WinControls.UI.RadLabel radLabel;  
    }  
 
    public partial class UserControl2 : UserControl {  
        public UserControl2() {  
            InitializeComponent();  
        }  
    }  
    partial class UserControl2 {  
        /// <summary>   
        /// Variable nĂ©cessaire au concepteur.  
        /// </summary> 
        private System.ComponentModel.IContainer components = null;  
 
        /// <summary>   
        /// Nettoyage des ressources utilisĂ©es.  
        /// </summary> 
        /// <param name="disposing">true si les ressources managĂ©es doivent Ăªtre supprimĂ©es ; sinon, false.</param> 
        protected override void Dispose(bool disposing) {  
            if (disposing && (components != null)) {  
                components.Dispose();  
            }  
            base.Dispose(disposing);  
        }  
 
        #region Code gĂ©nĂ©rĂ© par le Concepteur de composants  
 
        /// <summary>   
        /// MĂ©thode requise pour la prise en charge du concepteur - ne modifiez pas   
        /// le contenu de cette mĂ©thode avec l'Ă©diteur de code.  
        /// </summary> 
        private void InitializeComponent() {  
            this.radLabel = new Telerik.WinControls.UI.RadLabel();  
            ((System.ComponentModel.ISupportInitialize)(this.radLabel)).BeginInit();  
            this.SuspendLayout();  
            //   
            // radLabel  
            //   
            this.radLabel.AutoSize = false;  
            this.radLabel.Dock = System.Windows.Forms.DockStyle.Fill;  
            this.radLabel.Location = new System.Drawing.Point(0, 0);  
            this.radLabel.Name = "radLabel";  
            //   
            //   
            //   
            this.radLabel.RootElement.StretchHorizontally = true;  
            this.radLabel.RootElement.StretchVertically = true;  
            this.radLabel.Size = new System.Drawing.Size(218, 189);  
            this.radLabel.TabIndex = 1;  
            this.radLabel.Text = "Dock me elsewhere and the title will change. Please tell me how to keep the initi" +  
                "al one.";  
            //   
            // UserControl2  
            //   
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);  
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;  
            this.Controls.Add(this.radLabel);  
            this.Name = "UserControl2";  
            this.Size = new System.Drawing.Size(218, 189);  
            ((System.ComponentModel.ISupportInitialize)(this.radLabel)).EndInit();  
            this.ResumeLayout(false);  
 
        }  
 
        #endregion  
 
        private Telerik.WinControls.UI.RadLabel radLabel;  
    }  
 
}  
 

6 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 20 Oct 2009, 09:29 AM
Hi jpl,

Please read your support ticket (251086).

Kind regards,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
jpl
Top achievements
Rank 1
answered on 29 Oct 2009, 01:58 PM
The support ticket does not say anything. I still have troubles with Images and Title with toolBoxes :

=> the title does not display immediately. But as soon as I resize the Toolbox the title gets set.
=> the image is never displayed on the ToolBox tab. As soon as I dock the ToolBox as a document the image is displayed.
=> I cannot disable the system menu of a ToolBox. As soon as I dock the ToolBox as a document the system menu is disabled...

0
Albert Milton
Top achievements
Rank 1
answered on 25 May 2010, 09:42 PM
Telerik team, I have set the ImagePrimitive of Dock -> TabSrtripItem. But, during runtime the image is not showing, could you please help?
0
Nikolay
Telerik team
answered on 28 May 2010, 03:38 PM
Hi Albert Milton,

I was not able to reproduce the issue with the latest version Q1 2010 SP2 (v2010.1.10.504). I am attaching a sample project which demonstrates the correct behavior that I get on my side. If you continue experiencing the issue, open a new ticket and send me a sample project where the issue can be reproduced. This will allow me to understand your case and provide you with further assistance.

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
Albert Milton
Top achievements
Rank 1
answered on 09 Jun 2010, 02:58 PM
Hi,

Thanks for your example. I use  DockWindowPlaceHolder and ToolTabStrip. Its working for the tabbed document as it uses DocumentWindow. But, the image is not working for DockWindowPlaceHolder and ToolTabStrip. What is the code that we need to write to set the image for DockWindowPlaceHolder? I use the below code and it throwed and error as object reference not set to an instance..

DockWindowPlaceholder1.TabStripItem.Image = Global.Project1.My.Resources.Image1

Thanks,
Albert
0
Nikolay
Telerik team
answered on 16 Jun 2010, 01:24 PM
Hello Albert Milton,

Let's continue our conversation in the support ticket that you have opened for a similar question: Docking Manager Save and Load XML. In the ticket you can send me a sample project which demonstrates your scenario. This will allow me to understand your case and provide you with further assistance.

Best wishes,
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
jpl
Top achievements
Rank 1
Answers by
Nick
Telerik team
jpl
Top achievements
Rank 1
Albert Milton
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or