Make intellisense in app

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NetBurst
    New Member
    • Sep 2008
    • 3

    Make intellisense in app

    Hi =)
    I'm making an application which can compile batch scripts into executables. I have almost managed to make the intellisense thing, but it uses a listbox that is always visible to the right, and does not colorize the text like in VS.

    How can I get the intellisense window where I type like in VS and color the keywords in blue or something?

    Thanks for any help =)
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Just colorize words you have in your dictionary? Use a tooltip, or a label or something and just have it float near the mouse, they have a location property for a reason.

    Comment

    • NetBurst
      New Member
      • Sep 2008
      • 3

      #3
      I just can't figure out how to colorize specific words...
      Can someone show a basic "word colorizer" code snippet?
      Thanks

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well each label can have a single color applied to its text.
        RichTextBox can do multiple colors, but works like a textbox.
        Up to you how you implement it

        Comment

        • l034n
          New Member
          • Oct 2008
          • 15

          #5
          You may inherit a control from the one you're using and make it have custom properties for the text color. In your derived control, set:
          this.DrawMode = DrawMode.OwnerD rawFixed;
          Then, when adding items, you may use properties or a function for that, but you'll have to keep some internal table (or even better make a custom class for the items that you're adding) that will keep track of the color of the words.
          Then, override OnDrawItem and draw the items yourself. That way, anything (words, letters or whatever) can have the color you want.

          Comment

          • NetBurst
            New Member
            • Sep 2008
            • 3

            #6
            Ok, thanks for your support, I got it now! =D

            Comment

            Working...