Example #1
0
 private void cortarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (CampoDeTexto.SelectedText != "")
     {
         CampoDeTexto.Cut();
     }
 }
Example #2
0
 private void copiarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (CampoDeTexto.SelectionLength > 0)
     {
         CampoDeTexto.Copy();
     }
 }
Example #3
0
 private void CampoDeTexto_TextChanged(object sender, EventArgs e)
 {
     if (realizarCambios && coloreadoSelectivo)
     {
         realizarCambios = false;
         int numerolinea = CampoDeTexto.GetLineFromCharIndex(CampoDeTexto.SelectionStart) + 1;
         editadoDeTextoPorLinea(numerolinea);
         realizarCambios = true;
     }
 }
Example #4
0
 private void pegarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text) == true)
     {
         if (CampoDeTexto.SelectionLength > 0)
         {
             if (MessageBox.Show("¿Quieres pegar sobre la selección actual? ", "Aviso", MessageBoxButtons.YesNo) == DialogResult.No)
             {
                 CampoDeTexto.SelectionStart = CampoDeTexto.SelectionStart + CampoDeTexto.SelectionLength;
             }
         }
         CampoDeTexto.Paste();
     }
 }
Example #5
0
        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            carcater = 0;
            int ALTURA = CampoDeTexto.GetPositionFromCharIndex(0).Y;

            if (CampoDeTexto.Lines.Length > 0)
            {
                for (int i = 0; i < CampoDeTexto.Lines.Length; i++)
                {
                    e.Graphics.DrawString((i + 1).ToString(), CampoDeTexto.Font, Brushes.Black, pictureBox1.Width - (e.Graphics.MeasureString((i + 1).ToString(), CampoDeTexto.Font).Width + 10), ALTURA);
                    carcater += CampoDeTexto.Lines.ElementAt(i).Length + 1;
                    ALTURA    = CampoDeTexto.GetPositionFromCharIndex(carcater).Y;
                }
            }
            else
            {
                e.Graphics.DrawString("1", CampoDeTexto.Font, Brushes.Black, pictureBox1.Width - (e.Graphics.MeasureString("1", CampoDeTexto.Font).Width + 10), ALTURA);
            }
        }
Example #6
0
 private void CampoDeTexto_KeyDown(object sender, KeyEventArgs e)
 {
     UbicacionCarrete.Text = "Ubicacion: linea " + (CampoDeTexto.GetLineFromCharIndex(CampoDeTexto.SelectionStart) + 1);
 }