How will the new form move right

2 posts, 0 answers
  1. Zeng
    Zeng avatar
    3 posts
    Member since:
    Jan 2014

    Posted 02 Jul 2014 Link to this post

     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;
            }
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 04 Jul 2014 Link to this post

    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.
     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top