Subo cambios en plena produccion7
This commit is contained in:
@@ -15,14 +15,53 @@ namespace compabetov2
|
||||
{
|
||||
public partial class envios : Form
|
||||
{
|
||||
|
||||
private Point lastPoint;
|
||||
private LoginModel loginPrincipal;
|
||||
public envios(LoginModel loginPrincipal)
|
||||
{
|
||||
|
||||
|
||||
InitializeComponent();
|
||||
llenarPanel();
|
||||
this.loginPrincipal = loginPrincipal;
|
||||
}
|
||||
|
||||
private void InitializePanelEnvio()
|
||||
{
|
||||
// Asegúrate de que panelEnvio ya está creado en tu formulario
|
||||
|
||||
// Habilitar eventos táctiles simulados
|
||||
panelEnvio.MouseDown += PanelEnvio_MouseDown;
|
||||
panelEnvio.MouseMove += PanelEnvio_MouseMove;
|
||||
panelEnvio.MouseUp += PanelEnvio_MouseUp;
|
||||
}
|
||||
|
||||
private void PanelEnvio_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
lastPoint = new Point(e.X, e.Y);
|
||||
panelEnvio.Capture = true;
|
||||
}
|
||||
|
||||
private void PanelEnvio_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
int deltaX = lastPoint.X - e.X;
|
||||
int deltaY = lastPoint.Y - e.Y;
|
||||
|
||||
// Ajustar la dirección del desplazamiento
|
||||
panelEnvio.AutoScrollPosition = new Point(panelEnvio.AutoScrollPosition.X + deltaX, panelEnvio.AutoScrollPosition.Y - deltaY);
|
||||
|
||||
lastPoint = new Point(e.X, e.Y);
|
||||
}
|
||||
}
|
||||
|
||||
private void PanelEnvio_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
panelEnvio.Capture = false;
|
||||
}
|
||||
|
||||
private void llenarPanel()
|
||||
{
|
||||
panelEnvio.Controls.Clear();
|
||||
|
||||
Reference in New Issue
Block a user