Results 1 to 6 of 6

Thread: Adding IntelliSense

  1. #1

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Adding IntelliSense

    Adding a VBS Script Control and making it work with a TextBox or RichTextBox is very easy - but how do I add IntelliSense (autocomplete) to my TextBox? There must be a way to automatically retrive all available components of the Script Control or just calling up that list.

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Adding IntelliSense

    do you want to list the words starting with the letters typed in the textbox as the user types, then you can load all the related or matching words from a table into a listbox below the textbox.
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Adding IntelliSense

    and ofcourse put the code in the textbox's change event
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  4. #4

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Re: Adding IntelliSense

    No what I want is those IntelliSense list that resolves the properties of the current object when typing. Eg. I dynamically add multiple objects to the script control and when the user types xxx. the list should retrieve all properties and methods of xxx.

  5. #5
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Adding IntelliSense

    I'm not sure but I think this could help you (at least to get the same content that intellisense shows in VB). See my post #8 here..
    http://www.vbforums.com/showthread.php?t=375268
    With that Static created a treeview to show intellisense stuff more properly.
    With TypeLibINfo you can get the same info than intellisense and the Object Browser in VB, any control members and types, maybe the only hard part is finding where that info really is.
    About Scripting Control, I never used it, could you show your code? I want to give it a try also.
    Last edited by jcis; Mar 30th, 2006 at 02:56 PM.

  6. #6

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Re: Adding IntelliSense

    Thanks alot, this helps me to some point... but it does not solve the problem. You can try it out like this:

    Start a new Project and add the Microsoft Script Control, place it on Form1 and name it SC1

    Add a new Class1 and put in a dumb function like "Public Sub Test()" that shows a MsgBox.

    Now put a Command1 on Form1 with this code:

    VB Code:
    1. 'Make Form1 and a new Class1 accessible for the script
    2. SC1.AddObject "Form1", Form1, True
    3. SC1.AddObject "Class1", new Class1, True

    Now you can access both classes from within your scripts (otherwise you could only use VBs default commands for the script, like MsgBox and such). In my project this is done dynamically so I don't know what procedures the added classes will have.

    Well, add a List1 to Form1 and the following code:

    VB Code:
    1. Dim M As Module
    2.     Dim P As Procedure
    3.    
    4.     For Each M In SC1.Modules
    5.         List1.AddItem M.Name
    6.        
    7.         For Each P In M.Procedures
    8.             List1.AddItem "- " & P.Name
    9.         Next
    10.     Next

    This code is supposed to walk through each Module and each Module's Procedure within the Script Control. Well it does, but the only thing I get is "Global" and nothing more. The problem here is that "Modules" and "Procedures" are not the "Classes" and "Procedures" I mentioned before. Instead those are manually added items like those:

    VB Code:
    1. SC1.Modules.Add "Test"
    2.     SC1.Modules(2).AddCode "Sub Test()" & vbNewLine & "End Sub"

    And this is my problem - I can get a list of manually added stuff but I need a list of the Classes and their Procedures.
    Last edited by Fox; Mar 30th, 2006 at 04:24 PM.

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