Results 1 to 8 of 8
  1. #1
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored

    Question Digital Rune Texteditor [solved]

    Hey guys
    im currently coding a text editor with syntax highlighting. Im using the Digital Rune Texteditor (DigitalRune Text Editor - A Text Editor for .NET Windows Forms.) for that.
    Can someone tell me, how to make my own syntax highlighting for my own language?

    Thanks

  2. #2
    Nathan's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    In a magical place
    Posts
    6,113
    Reputation
    394
    Thanks
    363
    It's like this is all I say
    But, LEARN THE LANGUAGE FIRST!

    I'm sorry but that's the best answer I can give.

    And I don't thinks anyone else is going to help you.

    But if anyone can help you it's @Hassan, he made his own language.

  3. #3
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Uuh..srywhat?!
    Ive been programming in VB now for about 3 yearskk?
    Its just the first time im using this control.

  4. #4
    Nathan's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    In a magical place
    Posts
    6,113
    Reputation
    394
    Thanks
    363
    Quote Originally Posted by Vanoq View Post
    Uuh..srywhat?!
    Ive been programming in VB now for about 3 yearskk?
    Its just the first time im using this control.
    Okay, then ask @Hassan, he might know.

  5. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Multiple ways of going about it, finding the most efficient is the hardest part, and making it foolproof is also difficult. If you're triggering syntax highlighting on the "textchanged" event, you're going to have to do some filtering about where to start and finish applying the syntax highlighting, as a textbox with a hundred lines of text will start lagging insanely if the whole thing is being parsed for syntax highlighting EVERY TIME someone types.

    First step is to obtain a list of the words you want to highlight, you can find a lot of them on MSDN if you search for stuff like "Visual Basic Keywords List MSDN" or something like that.

    Next you've got to add that list somewhere into your project (either through My.Settings, or even in a .txt file accompanying the project and to be loaded into a list at runtime.

    After that, my idea would be to create a dictionary(Of String, Color) for each of the keywords, to add the color of their highlighting associated with the keyword.

    Now you'll need to write some method that takes an input string, and a richtextbox control and does all the syntax highlighting for that given string.

    That's really it.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  6. #6
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    It looks like you dont know DigitalRune, but thanks. I already got it working

  7. #7
    Nathan's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    In a magical place
    Posts
    6,113
    Reputation
    394
    Thanks
    363
    Quote Originally Posted by Vanoq View Post
    It looks like you dont know DigitalRune, but thanks. I already got it working
    Who were you talking to, Jason or me?

  8. #8
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Vanoq View Post
    Can someone tell me, how to make my own syntax highlighting for my own language?
    Thanks
    I assumed you didn't want to use DigitalRune any more and make your OWN syntax highlighting as you stated in your post -.-

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)