Parent Directory
|
Revision Log
|
Patch
--- trunk/Win32/libWin32/Win32/UI/MaskedHexBox.cs 2013/06/06 08:44:41 582 +++ trunk/Win32/libWin32/Win32/UI/MaskedHexBox.cs 2013/06/06 10:39:39 593 @@ -177,7 +177,17 @@ } private void btnCopy_Click(object sender, EventArgs e) { Clipboard.SetData(DataFormats.Text, this.Text); } - private void btnPaste_Click(object sender, EventArgs e) { if (this.ReadOnly) return; this.Text = (string)Clipboard.GetData(DataFormats.Text); } + private void btnPaste_Click(object sender, EventArgs e) + { + if (this.ReadOnly) return; + var rawText = (string)Clipboard.GetData(DataFormats.Text); + if (rawText.StartsWith("0x")) { rawText = rawText.Remove(0,2); } + if (rawText.StartsWith("x")) { rawText = rawText.Remove(0, 1); } + + rawText = rawText.PadLeft(this.TextLength, '0'); + rawText = string.Format("0x{0}", rawText); + this.Text = rawText; + } private void txtMaskedHexBox_MaskInputRejected(object sender, MaskInputRejectedEventArgs e) {
ViewVC Help | |
Powered by ViewVC 1.1.22 |