Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Error after selecting text in richtextbox

Error after selecting text in richtextbox

Scheduled Pinned Locked Moved C#
csharphelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Khawar Abbas1
    wrote on last edited by
    #1

    I am developing an application in C# and using richtextbox. After formatting the text when i select all the text it gives exception given below: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at RichTextEditor.Editor.ucEditor.rtbDoc_SelectionChanged(Object sender, EventArgs e) in E:\MDCENTERWINAPP\Editor\ucEditor.cs:line 841 at System.Windows.Forms.RichTextBox.OnSelectionChanged(EventArgs e) at System.Windows.Forms.RichTextBox.WmSelectionChange(SELCHANGE selChange) at System.Windows.Forms.RichTextBox.WmReflectNotify(Message& m) at System.Windows.Forms.RichTextBox.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Any Suggestion...............

    Do good and have good.

    A L 2 Replies Last reply
    0
    • K Khawar Abbas1

      I am developing an application in C# and using richtextbox. After formatting the text when i select all the text it gives exception given below: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at RichTextEditor.Editor.ucEditor.rtbDoc_SelectionChanged(Object sender, EventArgs e) in E:\MDCENTERWINAPP\Editor\ucEditor.cs:line 841 at System.Windows.Forms.RichTextBox.OnSelectionChanged(EventArgs e) at System.Windows.Forms.RichTextBox.WmSelectionChange(SELCHANGE selChange) at System.Windows.Forms.RichTextBox.WmReflectNotify(Message& m) at System.Windows.Forms.RichTextBox.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Any Suggestion...............

      Do good and have good.

      A Offline
      A Offline
      Alan N
      wrote on last edited by
      #2

      Hi, The message gives the location of the exception causing statement in the source code.

      Silent Eagle wrote:

      System.NullReferenceException: Object reference not set to an instance of an object. at RichTextEditor.Editor.ucEditor.rtbDoc_SelectionChanged(Object sender, EventArgs e) in E:\MDCENTERWINAPP\Editor\ucEditor.cs:line 841

      If the error on line 841 is not obvious, set a breakpoint there and investigate further with the debugger. Alan.

      1 Reply Last reply
      0
      • K Khawar Abbas1

        I am developing an application in C# and using richtextbox. After formatting the text when i select all the text it gives exception given below: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at RichTextEditor.Editor.ucEditor.rtbDoc_SelectionChanged(Object sender, EventArgs e) in E:\MDCENTERWINAPP\Editor\ucEditor.cs:line 841 at System.Windows.Forms.RichTextBox.OnSelectionChanged(EventArgs e) at System.Windows.Forms.RichTextBox.WmSelectionChange(SELCHANGE selChange) at System.Windows.Forms.RichTextBox.WmReflectNotify(Message& m) at System.Windows.Forms.RichTextBox.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Any Suggestion...............

        Do good and have good.

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi as Alan said, look at line 841. Read the Exception text, it is there to help you. Look in particular to the first line that mentions one of your filenames, and a line number. And tell Visual Studio to always show line numbers in edit windows (menu Tools/Options/TextEditor/AllLanguages...). :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups