Learn .NET from dotNetDave!

Fundamentals of the .NET Framework class will be starting up at UCSD Extensions in San Diego, Ca


Convert RTF to Text

If you need to convert RTF to text, here is a simple way of doing it:    Public Shared Function ConvertRtfToText(ByVal input As String) As String      Dim returnValue As String = String.Empty      Using converter As New System.Windows.Forms.RichTextBox()        converter.Rtf = input        returnValue = converter.Text      End Using      Return returnValue    End Function Tip Submitted By: David McCarter This code [...]

Ignoring Characters in a TexBox

The code below shows you how to ignore all input unless it's a number:private void searchText_KeyPress(object sender, KeyPressEventArgs e){ if (e.KeyChar != 8) {  if (char.IsNumber(e.KeyChar) == false)  {   e.Handled = true; }} I allow the backspace keypress by checking for character 8. You can easily modify this code to suit your needs.   Tip Submitted By: David McCarter