Problema al redimensionar botones C#

Iniciado por SrTrp, 15 Octubre 2018, 05:44 AM

0 Miembros y 1 Visitante están viendo este tema.

SrTrp

Quiero re dimensionar controles estoy intentando de esta forma
Código (csharp) [Seleccionar]


private void Form1_Resize(object sender, EventArgs e)
        {
         

            button1.Width = this.Width - 540;
            button2.Width = this.Width - 540;
            button3.Width = this.Width - 540;


            if (button2.Left <= 218)
            {
                button2.Left = this.Width - 522;
                if (button2.Left > 218)
                {
                    button2.Left = 218;
                }
            }
           
            if (button3.Left <= 423)
            {
                button3.Left = this.Width - 397;
                if (button3.Left > 423)
                {
                    button3.Left = 423;
                }
            }
        }

Para el boton1 y boton2 si se van ajustando y  moviendo perfectamente y pero para el boton 3 ahi es el problema termina donde debería de terminar pero al cuando estoy haciendo mas grande la ventana se va juntando el boton 2 con el 3 ya al final llega asú punto donde quiero sin que se junte,
datos que tengo
los botones comienzan con un Width=120 y Height = 60 y su máximo tamaño es de Width=200 y Height = 100