/[RomCheater]/trunk/Win32/libWin32/Win32/UI/MaskedHexBox.cs
ViewVC logotype

Diff of /trunk/Win32/libWin32/Win32/UI/MaskedHexBox.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 582 by william, Thu Jun 6 08:44:41 2013 UTC revision 593 by william, Thu Jun 6 10:39:39 2013 UTC
# Line 177  namespace System.Windows.Forms Line 177  namespace System.Windows.Forms
177          }          }
178    
179          private void btnCopy_Click(object sender, EventArgs e) { Clipboard.SetData(DataFormats.Text, this.Text); }          private void btnCopy_Click(object sender, EventArgs e) { Clipboard.SetData(DataFormats.Text, this.Text); }
180          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)
181            {
182                if (this.ReadOnly) return;
183                var rawText = (string)Clipboard.GetData(DataFormats.Text);
184                if (rawText.StartsWith("0x")) { rawText = rawText.Remove(0,2); }
185                if (rawText.StartsWith("x")) { rawText = rawText.Remove(0, 1); }
186    
187                rawText = rawText.PadLeft(this.TextLength, '0');
188                rawText = string.Format("0x{0}", rawText);
189                this.Text = rawText;
190            }
191    
192          private void txtMaskedHexBox_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)          private void txtMaskedHexBox_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
193          {          {

Legend:
Removed from v.582  
changed lines
  Added in v.593

  ViewVC Help
Powered by ViewVC 1.1.22