|
-
Mar 30th, 2006, 01:22 AM
#1
Thread Starter
PowerPoster
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.
-
Mar 30th, 2006, 02:42 AM
#2
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.
-
Mar 30th, 2006, 02:42 AM
#3
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.
-
Mar 30th, 2006, 02:22 PM
#4
Thread Starter
PowerPoster
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.
-
Mar 30th, 2006, 02:52 PM
#5
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.
-
Mar 30th, 2006, 04:13 PM
#6
Thread Starter
PowerPoster
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:
'Make Form1 and a new Class1 accessible for the script
SC1.AddObject "Form1", Form1, True
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:
Dim M As Module
Dim P As Procedure
For Each M In SC1.Modules
List1.AddItem M.Name
For Each P In M.Procedures
List1.AddItem "- " & P.Name
Next
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:
SC1.Modules.Add "Test"
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|