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 / C++ / MFC
  4. RichTextCtrl

RichTextCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
2 Posts 2 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.
  • T Offline
    T Offline
    ThomasKennedyBose
    wrote on last edited by
    #1

    hi i have placed a RichTextControl in a dialogbox.i want to know some code about it 1.when i press enterbutton after adding some text in it cursor is not going to next line 2.how to write code for SetSelBold() and SetSelColor() and all these functions? 3.i'm giving the file name at runtime in my InitDialog() as below ::OnInitDialog() { CString str; str = "D:\\Bose\\Opms\\src\\"; str += pDoc->GetModelTextName(); str += ".prs"; VARIANT var; InitVariant(&var); m_RichText.Loadfile(str,&var); } when i run my program it giving "The specified file/path is invalid"message. how to avoid it? please help me if anybody know code for it

    M 1 Reply Last reply
    0
    • T ThomasKennedyBose

      hi i have placed a RichTextControl in a dialogbox.i want to know some code about it 1.when i press enterbutton after adding some text in it cursor is not going to next line 2.how to write code for SetSelBold() and SetSelColor() and all these functions? 3.i'm giving the file name at runtime in my InitDialog() as below ::OnInitDialog() { CString str; str = "D:\\Bose\\Opms\\src\\"; str += pDoc->GetModelTextName(); str += ".prs"; VARIANT var; InitVariant(&var); m_RichText.Loadfile(str,&var); } when i run my program it giving "The specified file/path is invalid"message. how to avoid it? please help me if anybody know code for it

      M Offline
      M Offline
      Mike Melnikov
      wrote on last edited by
      #2

      Hi 1. catch your enterbutton in BOOL CYourDlg::OnApply() { // do something with m_RichText; return FALSE; } also your can use OnChar(...) fiunction 2. a sample m_RichText.SetSel(0,-1); CHARFORMAT cf; cf.dwMask = CFM_SIZE|CFM_COLOR|CFM_UNDERLINE; cf.dwEffects = CFE_UNDERLINE; cf.crTextColor = RGB( 0, 0,255); cf.yHeight = 120; m_RichText.SetWordCharFormat(cf); 3. the simplest way try { ... m_RichText.LoadFile(..); } catch(...) { } Mike.

      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