CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    How do i find the number of characters in a rich edit control?

    I'm using vb6 and the richedit 2.0 control. I want to be able to quickly get the number of characters in the control. (other than using len(textrtf) which is waaaay to slow) I know that there is a user defined message for the control (EM_GETTEXTLENGTHEX), that i found in msdn. This message takes a c structure as one of its parameters, i set all this up from the information in richedit.h but i don't think the data types are compatible. Has anyone used this message in vb before, or has another way to get this information?


  2. #2
    Join Date
    Dec 1999
    Location
    Dallas, Texas, USA
    Posts
    59

    Re: How do i find the number of characters in a rich edit control?

    This should work quickly..


    iCount = len(replace(RichEditBox1.Text," ",""))




    --
    Chizl
    [email protected]
    http://www.chizl.com/

  3. #3
    Guest

    Re: How do i find the number of characters in a rich edit control?

    I'm not trying to simply ignore spaces, in the end, i'm trying to find the number of bytes in the control. I cannot simply reference the text or textRTF properties of the control in visual basic, every time that happens, the computer pauses while it brings the variable into a vb string (this takes a long time if you have ole images in the rich text control)... so i need to use a message of some sort.


  4. #4
    Guest

    Re: How do i find the number of characters in a rich edit control?

    nevermind... the vb ocx of the rich edit control is the 1.0 version of the rich edit control, which doesn't understand this message. I had to do a loadlibrary on the riched20.dll and do a CreateWindowEx to put the 2.0 control on the form. Now it understands the message, but now i lose the ease of the ocx typelib and have to do everything myself.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured