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

How will the new form move right

1 Answer 13 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Zeng
Top achievements
Rank 1
Zeng asked on 02 Jul 2014, 06:08 AM
 public partial class FrmMain : Telerik.WinControls.UI.RadForm
    {
        DocumentContainer documentContainer = new DocumentContainer();
        public FrmMain()
        {
            InitializeComponent();
            this.IsMdiContainer = true;
            this.radDock1.AutoDetectMdiChildren = true;
            
            this.radDock1.MainDocumentContainer = documentContainer;
        }

        private void radButton1_Click(object sender, EventArgs e)
        {
            FrmLogin frm1 = new FrmLogin();
            frm1.MdiParent = this;
            frm1.Show();
            this.ActiveControl = frm1;
        }

        private void radButton2_Click(object sender, EventArgs e)
        {
            RadForm2 frm2 = new RadForm2();
            frm2.MdiParent = this;
            frm2.WindowState = FormWindowState.Maximized;
            frm2.Show();
            this.ActiveControl = frm2;
        }

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 04 Jul 2014, 03:35 PM
Hi Zeng,

Thank you for contacting us.

There seems to be an issue with the attachment. It appears that because the filename of the image contains special characters, it cannot be found on our servers. Therefore, given just the sample code and the ticket title, I am not sure I understand your requirement.

If the case is that you need to dock the second form to the right, then you can get the form's HostWindow from its Parent property and use the DockWindow method of RadDock:
    public Form1()
    {
        InitializeComponent();
        this.IsMdiContainer = true;
        this.radDock1.AutoDetectMdiChildren = true;
    }
 
    private void radButton1_Click(object sender, EventArgs e)
    {
        Form frm1 = new Form() { Text = "Form 1" };
        frm1.MdiParent = this;
        frm1.Show();
        this.ActiveControl = frm1;
 
        HostWindow hw = frm1.Parent as HostWindow;
 
        if (hw != null)
        {
            this.radDock1.DockWindow(hw, DockPosition.Left);
        }
    }
 
    private void radButton2_Click(object sender, EventArgs e)
    {
        RadForm frm2 = new RadForm() { Text = "Form 2" };
        frm2.MdiParent = this;
        frm2.WindowState = FormWindowState.Maximized;
        frm2.Show();
        this.ActiveControl = frm2;
        HostWindow hw = frm2.Parent as HostWindow;
 
        if (hw != null)
        {
            this.radDock1.DockWindow(hw, DockPosition.Right);
        }
    }
}

If this is not the case, please provide a detailed description of your requirement and try to attach the picture with no special characters in the file name (you can rename it to a number-only string to make sure I am able to open it). Understanding the case will let me provide you with further support.

Let me know if I can assist you further.

Regards,
Ivan Todorov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Dock
Asked by
Zeng
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or