As the title says, I have a variable declared at the class level but it gives me that message but I do use it.
public partial class TextBoxUniversal : TextBox
{
private bool Sombra;
private bool _mTeclaPermitida = true; Mensaje de advertencia
//private string separafecha = "/";
private Font oldFont = null;
private Boolean waterMarkTextEnabled = false;
[System.Diagnostics.DebuggerStepThrough]
protected override void WndProc(ref Message m)
{
const Int32 emUndo = 0xc7;// Es el mensaje Deshacer para los controles TextBox de una única línea.
const Int32 wmClear = 0x303;
const Int32 wmCopy = 0x301;
const Int32 wmCut = 0x300;
const Int32 wmPaste = 0x0302;
const Int32 wmUndo = 0x304;// Es el mensaje Deshacer para los controles TextBox multilínea.
switch (m.Msg)
{
case wmClear:
_mTeclaPermitida = true;
break;
case wmCopy:
_mTeclaPermitida = true;
break;
case wmCut:
_mTeclaPermitida = true;
break;
case wmPaste:
var dataObject = Clipboard.GetDataObject();
if (dataObject != null && !(dataObject.GetDataPresent(DataFormats.Text)))
return;
// Comprobamos si el contenido del portapapeles es numérico.
if ((!(ValidateClipboardText())))
{
_mTeclaPermitida = false;
return;
}
_mTeclaPermitida = true;
break;
case emUndo:
_mTeclaPermitida = true;
break;
case wmUndo:
_mTeclaPermitida = true;
break;
}
// Procesamos los restantes mensajes
base.WndProc(ref m);
}
How can I correct so you do not give me that message?