private void FrmImagenAmpliada_Load(object sender, EventArgs e) { try { pictureBox3.Image = recursos.folder_image; pictureBox2.Image = recursos.gtk_close_55; Image newImage = null; //Read image data into a memory stream using (MemoryStream ms = new MemoryStream(Imagen, 0, Imagen.Length)) { ms.Write(Imagen, 0, Imagen.Length); //Set image variable value using memory stream. newImage = Image.FromStream(ms, true); } //set picture if (newImage != null) { pictureBox1.Image = newImage; loadedImage = newImage; } if (newImage.Size.Height > Screen.PrimaryScreen.WorkingArea.Height - 25 || newImage.Size.Width > Screen.PrimaryScreen.WorkingArea.Width - 25) { CalcularTamañoMaximoLienzoConImagen(pictureBox1.Image, pictureBox1); } else { pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize; } int X = 0; int Y = 0; Y = pictureBox1.Size.Height + 22; X = pictureBox1.Size.Width + 22; panel1.Size = new Size(X, Y); Y = 0; Y = panel1.Height + 15; this.Size = new Size(X + 75, Y); pictureBox1.Location = new Point(11, 11); this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2; this.Left = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2; panel1.Region = Shape.RoundedRegion(panel1.Size, 3, Shape.Corner.None); pictureBox2.Location = new Point(panel1.Width + 13, panel1.Height - pictureBox2.Height + 15); label1.Location = new Point(panel1.Width + 20, panel1.Height - pictureBox2.Height + 7); pictureBox3.Location = new Point(panel1.Width + 15, panel1.Height - pictureBox2.Height - 14 - label1.Height - pictureBox3.Height + 14); btnPaint.Location = new Point(panel1.Width + 15, 8); } catch { } }
public ImageDialog(Size pSize, ArrayList pValues) { InitializeComponent(); this.Size = pSize; oValues = pValues; this.imageViewerFull.ImageNumber = (int)pValues[0]; this.imageViewerFull.ImageBytes = (byte[])pValues[1]; this.imageViewerFull.TempImageLocation = (string)pValues[2]; this.Region = Shape.RoundedRegion(this.Size, 7, Shape.Corner.None); }
private void FrmLogin_Load(object sender, EventArgs e) { TraerLogo(); LlenarComboLogins(); label5.Visible = false; if (Control.IsKeyLocked(Keys.CapsLock)) { label5.Visible = true; } TxtUsuario.Focus(); this.pictureBox1.Region = Shape.RoundedRegion(pictureBox1.Size, 1, Shape.Corner.None); this.pictureBox6.Region = Shape.RoundedRegion(pictureBox6.Size, 1, Shape.Corner.None); Program.oFrmIntro.Visible = false; Program.oMDI.Opacity = 1; Program.oFrmOrb.Show(Program.oMDI); }
private void FrmIntro_Load(object sender, EventArgs e) { this.Region = Shape.RoundedRegion(this.Size, 2, Shape.Corner.None); }
bool BotonPresionado = false;//Verifica que se haya presionado un botón para determinar que acción realizar y no simplemente cerrar el form public FrmSolicitudAdmin() { InitializeComponent(); this.Region = Shape.RoundedRegion(this.Size, 6, Shape.Corner.None); }
private void FrmSeguridad_Load(object sender, EventArgs e) { if (VerificarEmpleadosIngresados() == true) { try { VistaConstants.SetWindowTheme(lstRoles.Handle, "explorer", null); //Explorer style VistaConstants.SendMessage(lstRoles.Handle, VistaConstants.LVM_SETEXTENDEDLISTVIEWSTYLE, VistaConstants.LVS_EX_DOUBLEBUFFER, VistaConstants.LVS_EX_DOUBLEBUFFER); VistaConstants.SetWindowTheme(LstRolesXUsuario.Handle, "explorer", null); //Explorer style VistaConstants.SendMessage(LstRolesXUsuario.Handle, VistaConstants.LVM_SETEXTENDEDLISTVIEWSTYLE, VistaConstants.LVS_EX_DOUBLEBUFFER, VistaConstants.LVS_EX_DOUBLEBUFFER); VistaConstants.SetWindowTheme(LstUsuarioEmpleado.Handle, "explorer", null); //Explorer style VistaConstants.SendMessage(LstUsuarioEmpleado.Handle, VistaConstants.LVM_SETEXTENDEDLISTVIEWSTYLE, VistaConstants.LVS_EX_DOUBLEBUFFER, VistaConstants.LVS_EX_DOUBLEBUFFER); } catch { } cargarRoles(); //cargarBaseDatos(); DataSet ds2 = Program.oPersistencia.ejecutarSQLListas("Select id_emp, nombre from Empleados", "Empleados"); this.CmbEmpleados.DataSource = ds2.Tables["Empleados"]; this.CmbEmpleados.DisplayMember = ds2.Tables["Empleados"].Columns[1].ToString(); this.CmbEmpleados.ValueMember = ds2.Tables["Empleados"].Columns[0].ToString(); this.CmbEmpleados2.DataSource = ds2.Tables["Empleados"]; this.CmbEmpleados2.DisplayMember = ds2.Tables["Empleados"].Columns[1].ToString(); this.CmbEmpleados2.ValueMember = ds2.Tables["Empleados"].Columns[0].ToString(); ds2.Dispose(); LlenarCombos(); this.BtnEliminar.Region = Shape.RoundedRegion(BtnEliminar.Size, 2, Shape.Corner.None); this.BtnUsuarioEmpleado.Region = Shape.RoundedRegion(BtnUsuarioEmpleado.Size, 2, Shape.Corner.None); this.button3.Region = Shape.RoundedRegion(button3.Size, 2, Shape.Corner.None); this.button1.Region = Shape.RoundedRegion(button1.Size, 2, Shape.Corner.None); this.BtnCrearLogin1.Region = Shape.RoundedRegion(BtnCrearLogin1.Size, 2, Shape.Corner.None); this.BtnCrearRol1.Region = Shape.RoundedRegion(BtnCrearRol1.Size, 2, Shape.Corner.None); this.BtnAsignarUsuario.Region = Shape.RoundedRegion(BtnAsignarUsuario.Size, 2, Shape.Corner.None); this.BtnCerrarListaUsuarios.Region = Shape.RoundedRegion(BtnCerrarListaUsuarios.Size, 2, Shape.Corner.None); this.BtnCerrarListaRolesUsuario.Region = Shape.RoundedRegion(BtnCerrarListaRolesUsuario.Size, 2, Shape.Corner.None); this.button2.Region = Shape.RoundedRegion(button2.Size, 2, Shape.Corner.None); //if (cmbLogin.Items.Count > 0) // button2.Enabled = false;//Botón para ver roles por usuario cmbBaseDatos.SelectedIndex = 0; } else { if (MessageBox.Show(this, "No puede continuar hasta haber ingresado los empleados que utilizarán el sistema. ¿Desea realizar estas acciones en este momento?", "Atención", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { this.Close(); this.Dispose(); FrmMantEmpleados oFrmMantEmpleados = new FrmMantEmpleados(); oFrmMantEmpleados.ShowDialog(); } else { this.Close(); this.Dispose(); } } }