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. Custom text edit control???

Custom text edit control???

Scheduled Pinned Locked Moved C#
tutorialquestion
8 Posts 4 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.
  • C Offline
    C Offline
    Cristoff
    wrote on last edited by
    #1

    I'm looking for an example how to write custom text edit control. Not a subclassed textbox but one that is written from the ground up.

    C L 2 Replies Last reply
    0
    • C Cristoff

      I'm looking for an example how to write custom text edit control. Not a subclassed textbox but one that is written from the ground up.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Why do you need one ? I've looked and not found one in the past, but I got around the vagaries of the text box control ( namely that it draws itself out of the paint event ) with a bit of work. Christian Graus - Microsoft MVP - C++

      C 1 Reply Last reply
      0
      • C Christian Graus

        Why do you need one ? I've looked and not found one in the past, but I got around the vagaries of the text box control ( namely that it draws itself out of the paint event ) with a bit of work. Christian Graus - Microsoft MVP - C++

        C Offline
        C Offline
        Cristoff
        wrote on last edited by
        #3

        Because I need to have a control over each line/paragraph etc. I want to make something like a custom text editor that outputs to a custom XML formats, depending on the context or the template. For now I cannot find any XML editor that can do what I need and I think the built in TextBox and RichTextBox controls won't do what I want to do. This is what I want to do and the next thing that is independent of the above is that I want to see how text is handled in text editors and displayed on a form/control.

        1 Reply Last reply
        0
        • C Cristoff

          I'm looking for an example how to write custom text edit control. Not a subclassed textbox but one that is written from the ground up.

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          I have written one from complete scratch (iow painting every pixel). You can have a look at the source, but beware, the editor control alone is current almost 200kb (7000+ lines) in size. Follow either link below and see the link on the left of the page. :)**

          How xacc.ide transforms text to colored words on the screen
          Intel PentuimM (aka Centrino) undervolting

          **

          C 1 Reply Last reply
          0
          • L leppie

            I have written one from complete scratch (iow painting every pixel). You can have a look at the source, but beware, the editor control alone is current almost 200kb (7000+ lines) in size. Follow either link below and see the link on the left of the page. :)**

            How xacc.ide transforms text to colored words on the screen
            Intel PentuimM (aka Centrino) undervolting

            **

            C Offline
            C Offline
            Cristoff
            wrote on last edited by
            #5

            I know your control, leppie! Thank you! I was overwhelmed :) I hoped there was something simpler. I much time have you spent researching, planning and creating it? Have you ever thought writing an article about it?

            L 1 Reply Last reply
            0
            • C Cristoff

              I know your control, leppie! Thank you! I was overwhelmed :) I hoped there was something simpler. I much time have you spent researching, planning and creating it? Have you ever thought writing an article about it?

              L Offline
              L Offline
              leppie
              wrote on last edited by
              #6

              Cristoff wrote:

              much time have you spent researching, planning and creating it?

              It had a few incarnations, so I am not really sure :~ The project has been ongoing now for over 3 years :)

              Cristoff wrote:

              Have you ever thought writing an article about it?

              Dreamt about it, yes alot! Reality, it's so much info to transfer, I am not sure I will be able to ever explain it all to anyone :| I have decided to start writing small parts for documentation and post it to my blog. Hopefully one day all the info I have prodived on the blog can be compiled and edited :) What I suggest, start off with a string[] for the lines, do a simple DrawString for the text. Find out what metrics you need like line height, and familiarize yourself with that. Then move on to selecting text, you will need some form of MeasureString here. After that make the caret, if needed, some people simply PInvoke this functionality. Finally if editing is required, do that. And then only start messing with colors and such. Hope this helps a bit, I used a similar path. :)**

              How xacc.ide transforms text to colored words on the screen
              Intel PentuimM (aka Centrino) undervolting

              **

              R C 2 Replies Last reply
              0
              • L leppie

                Cristoff wrote:

                much time have you spent researching, planning and creating it?

                It had a few incarnations, so I am not really sure :~ The project has been ongoing now for over 3 years :)

                Cristoff wrote:

                Have you ever thought writing an article about it?

                Dreamt about it, yes alot! Reality, it's so much info to transfer, I am not sure I will be able to ever explain it all to anyone :| I have decided to start writing small parts for documentation and post it to my blog. Hopefully one day all the info I have prodived on the blog can be compiled and edited :) What I suggest, start off with a string[] for the lines, do a simple DrawString for the text. Find out what metrics you need like line height, and familiarize yourself with that. Then move on to selecting text, you will need some form of MeasureString here. After that make the caret, if needed, some people simply PInvoke this functionality. Finally if editing is required, do that. And then only start messing with colors and such. Hope this helps a bit, I used a similar path. :)**

                How xacc.ide transforms text to colored words on the screen
                Intel PentuimM (aka Centrino) undervolting

                **

                R Offline
                R Offline
                Rei Miyasaka
                wrote on last edited by
                #7

                I'd love to see this too... let me know when you publicize it :)

                1 Reply Last reply
                0
                • L leppie

                  Cristoff wrote:

                  much time have you spent researching, planning and creating it?

                  It had a few incarnations, so I am not really sure :~ The project has been ongoing now for over 3 years :)

                  Cristoff wrote:

                  Have you ever thought writing an article about it?

                  Dreamt about it, yes alot! Reality, it's so much info to transfer, I am not sure I will be able to ever explain it all to anyone :| I have decided to start writing small parts for documentation and post it to my blog. Hopefully one day all the info I have prodived on the blog can be compiled and edited :) What I suggest, start off with a string[] for the lines, do a simple DrawString for the text. Find out what metrics you need like line height, and familiarize yourself with that. Then move on to selecting text, you will need some form of MeasureString here. After that make the caret, if needed, some people simply PInvoke this functionality. Finally if editing is required, do that. And then only start messing with colors and such. Hope this helps a bit, I used a similar path. :)**

                  How xacc.ide transforms text to colored words on the screen
                  Intel PentuimM (aka Centrino) undervolting

                  **

                  C Offline
                  C Offline
                  Cristoff
                  wrote on last edited by
                  #8

                  Thank you for the tips. How would you use string[]? For example you'll reserve 1000 lines then when 999 are used you'll expand the array by another 1000 lines. We'll this be fast and good enough? Colors I might not need but who knows :) What I need to know is exactly what line I'm editing.

                  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