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. Using Visio Drawing Control 2003 with System.Windows.Forms.RichTextBox

Using Visio Drawing Control 2003 with System.Windows.Forms.RichTextBox

Scheduled Pinned Locked Moved C#
graphicsperformancehelpquestion
1 Posts 1 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.
  • A Offline
    A Offline
    Abisodun
    wrote on last edited by
    #1

    I'm having difficulty using the Visio Drawing Control 2003 and the RichTextBox anywhere in the same application. e.g. public partial class VisForm : Form { public VisForm() { //RichTextBox rttb = new RichTextBox(); //string rtf = rttb.Rtf; //rttb.SelectedRtf = @"{\rtf1\ansi " + "Visible" + @"{\v " + "Hidden" + @"}}"; //string rtfText = rttb.Text; InitializeComponent(); RichTextBox rttb1 = new RichTextBox(); string rtf1 = rttb1.Rtf; rttb1.SelectedRtf = @"{\rtf1\ansi " + "Visible" + @"{\v " + "Hidden" + @"}}"; string rtfText1 = rttb1.Text; } --- } First Scenario: Initialize the RichTextBox BEFORE the Visio Drawing Control. Set rttb.SelectedRtf = @"{\rtf1\ansi " + "Visible" + @"{\v " + "Hidden" + @"}}"; rttb.Text will then be "VisibleHidden" which is correct. With the form displayed press CTRL+F to display the Find Dialog. The result is an AccessViolationException with the following message: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt". Second Scenario: Initialize the RichTextBox AFTER the Visio Drawing Control. Set rttb.SelectedRtf = @"{\rtf1\ansi " + "Visible" + @"{\v " + "Hidden" + @"}}"; rttb.Text will then be "Visible" which is WRONG. i.e. the hidden text does not get set when the Visio Control is initialized before the RichTextBox. With the form displayed, this time pressing CTRL+F results in the Find Dialog being displayed with no problem. Any ideas? Thanks, B.

    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