Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Intellisense W/ Classes?


Sometimes when I'm working with classes and I have Dim'd a class object, the intellisense for the object won't show up while I'm coding. This is really annoying and I can't figure it out. For some class objects the intellisense comes up, but for others (of a different class) it doesn't. Anyone know why this happens? I'm very curious...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Intellisense
Has anyone created Intellisense in there program where a user enters text into a box, and when they hit a certain key (ie ".") it pops up a list of options?

I've been using a combobox to do this, but maybe there's a way to pop up a menu the way Visual Basic does it? Though I haven't seen any examples.

VB Intellisense
Hi All,
I'm here with couple of questions,

1.How we can implement intellisense(Quick info,Parameter info) when i enter my own function in a VB6 Text box? could anyone suggest any activeX control with this functionality?

2.How we can apply color to a particular letter?For example,if we type a combination of function in a excel cells only brackets"()" appears in different color.I want to implement this functionality for vb text box.


Code:
SUM(K9:K12+(AVERAGE(N7:N17)))


Thanks in advance...

Intellisense
I know this is a long shot, but ...

Does anyone know of any "hack" examples for intellisense? What I would ultimately want to do is shade some line items in intellisense when it pops up for some enumerations. If anyone has any examples of hacking intellisense (even if unrelated to what I want to acheive) please supply a reference. Any help greatly appreciated.

IntelliSense HELP
Dear all,

I have been developing a wizard that produces ASP code, now my first version is out at http://www.aspwizard.co.uk, i want to develop my 2 generation, and i wanted to use, whats called "IntelliSense", like when we using msaccess or vb, if we say print.[dropdown] a drop downbox will come up, and we select as necessary. that is waht I wanted to do.

Thank you for your help

ADO Intellisense
I'm using ADO in my VB program and not getting the Intellisense hints...but the
ADO still works.
How do I get the intellisense hints?

Thanks,
Barry

Intellisense
In vb6, is there a way to use intellisense to access properties of the object ?

do we have to enable it some how ?

thanks.

VB IntelliSense
A colleague of mine is experiencing some problems with the IntelliSense in VB 6.0. Here is the scenario...

He creates a class module. The class module has public properties and procedures...

From an existing class module, he declares and instantiates the new class. No evident spelling errors. The new class object is instantiated in the Class Initialize event of the existing class and declared at module level. This should allow the developer to view any public properties or procedures residing in the new class...This is not the case. For some reason the IntelliSense does not work.

My question is...

Has anyone else experienced this type of reaction from the VB IntelliSense before?????? Any ideas of what to do.

Thanks,
Sam

Emulating IntelliSense...
Hi gurus,

I'm trying to emulate intelliSense in my "Database Explorer" Application.

What i want to do is, when i press Ctrl+Espace, it lists the tables available on the connected database, and when i press . (dot), it lists the columm for the current table...

I already know how to list the tables and columns, the only problem is the list.

I created a ComboBox, behind the Main TextBox (as u can see in the picture), and used a code to DropDown the combo (yes, it shows), the only problem is the focus, i can't navigate through the results...

(Oh, forgot...)

I must reposition the combo on the TextBox caret position, is there any way to get the X,Y position of the caret ?

Have any of you trying to do something like this ?
How did u do that ?

Thanx all
Best Regards,

Creating IntelliSense
The Problem: The IntelliSense List does not appear where the cursor is (in a rich text box). Is there a function to acquire X and Y coordinates where the list should be placed?

Thanks in advance, TNT.

VB Problem {no Intellisense}
I got a little problem. You know how when you type a object in and it will drop a little box down with the actions it will do, well i don't know if i tuned somthing off, but it won't do that now.

Left$, Right$ No Intellisense
Hi guys,
I donot find any intellisense poping up when I type Left$ or Right$ in VB6 (default settings) am I missing something.
Thanks in advance.

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.

Colletions And Intellisense
I am trying to understand this collection stuff. I use it all the time with ADO, but I thought I would try to write one to learn. In ADO the Recordset object has a collection of Fields. Those Fields have a Value property. Now in the VB IDE, When I do rs.Fields(0). <--notice the dot, Then up comes intellisense with properties and methods like 'Value'. I tryed to build the same structure, but Intellisense only shows the properties and methods of a colloection object:

VB Code:
Private Sub Form_Load()    Dim acol As New Collection    Dim obj As New myClass    obj.val1 = "x"    acol.Add obj    Debug.Print acol.Item(1).value 'No intellisense for ValueEnd Sub 'myClass codeDim onePublic Property Let val1(x)    one = xEnd Property Public Property Get val1()    val1 = oneEnd Property Public Function value()    value = val1End Function

Making Use Of IntelliSense
Hi

How can I create class properties so that when they are called from a form they list all the available options.

eg Dim objAccount as cAccount

Set ObjAccount = new CAccount

ObjAccount.type = ( List of avaible types)

Likewise when creating a function, how can I have the calling form view a list of the avaiable choices for one of the parameters

Is it done using Enums or types

Please help

regards

Mark

Toggle Intellisense ? ? !
My intellisense has disappeared !!! is there a way to make it toggle back on?

Losing IntelliSense
When I open one of my VB applications, there is no IntelliSense. I only have this problem with one specific app. Does anyone have any ideas as to what may be causing this or more importantly how I can fix it?

Lost My Intellisense
Hi,
I have lost my intelliSense for Visual Basic 6.0
It worked perfect yesterday.

Does anyone have any idea how to get it back?

/George

Problem With Intellisense
OK this one is not really a programming problem
but anyways here is the scenario :

I have a module with all my type declarations.
I have a module for functions, in one of the functions I would like to send one of types over. But when it is declared in the parameters intellisense for the function is turned off.

Example From Module1

Code:

Public Type A_JobData
JobName As String
TotalCost As Double
TotalDays As Double
StartDate As Date
EndDate As Date
End Type


Example for Module2

Code:

Private Function PrintJobReport(Byval MyJob as A_JobData) as Boolean

Intellisense for everything is off!
Even hitting Ctrl+SpaceBar just beeps

Anybody?

EDIT: Sending ByRef instead of ByVal fixes that... But still that is wierd

Intellisense Bug On Object Array
Code:
'c is a class
Dim one(1 To 2) As c
Dim two(1 To 2, 1 To 2) As c

one. 'triggers
one(1). 'triggers
one(1,2). 'triggers
two. 'triggers
two(1). 'doesn't trigger
two(1,2). 'doesn't trigger

The last 2 lines don't trigger intellisense. Any way to fix that? I tried google but found very little on intellisense bugs in VB, though a whole lot on the issue in VB.Net...

UPDATE: Using a With-block, intellisense is triggered if and only if the array is properly indexed - as it should be

UPDATE 2: [getting really freaked out now]

Right, I tried intellisense for the next level, i.e. a method (aa) in c that takes arguments. This is what I get:


Code:
one.aa( 'doesn't trigger
one(1).aa( 'triggers
one(1, 2).aa( 'triggers
two.aa( 'doesn't trigger
two(1).aa( 'doesn't trigger
two(1, 2).aa( 'doesn't trigger

I can't say I see any pattern, apart from there being a problem with multidimensional object arrays without With-blocks.
Maybe they decided that the use of those should be discouraged?

Imitate The Intellisense Function
Hi there!
Sorry for my terrible english, but I hope it will be clear, what i'm asking for. ;-)
I'd need a way to get the list of functions/properties/... of classes as the IDE's intellisense does it. I have an vb script core within my app and from there access to my class structure. Now i'd need a way to simulate this function within my running app. i edit an execute some scripts within an textbox. But how can it be done, that i get the list of available functions/properties/subcalsses each time the "." is pressed. (e.g. on typing myclass1. -> i'll get a list with property1,property2,subclass1,... as it is shown within the VB IDE)
I don't need to get the further details (as type of the variables...), only a list for easier programming. CAN THIS BE DONE?

Yours
Peter

Namespace And Intellisense Menu
When we are working in VB.NET for example writing any application, how we can say that this namesapce have this particular classes and methods. Explain me with the help of an example.

And Also when we type the name of the object, a intellisense menu appear, from that we select one of them, Tell me which one is a method and which one is a property of the object.

Thanks

Intellisense Dropdown Menus?
how do i make a Intellisense dropdown menu with some words in it to my rich text box?

so for examle i type "hello" and then "." a Intellisense dropdown menu will come with "world", "me", "every1"

any links or codes will really help

Vb's Intellisense Doesn't Work
Hi
say i have declare the following types


VB Code:
Public Type objinner   Top As String   Bottom As String End Type Public Type obj   Something As String   subobj As objinner End Type Public Myobj As obj


now i m wrinting Myobj.subobj and then press the dot ".". Vb's intellisense feature is supposed to drop down the list box but it doesn't why? am i missing somthing?

Adding A Description To Intellisense Pop-up
How do I?

So that typing myclass.<pop up property/method name> has a little description of what is expected afer it?

ta in advance

Auto Complete(Intellisense) In VBA ?
I am new to VBA programming and wondering if there is an Auto-complete feature for VBA, the same as what you have in Visual Basic ?







A VB turned PHP geek

Structures In .net Dll Only Showing Up To One Layer In Intellisense In Vb6.0
Hi everyone,
I have a dll (MyDll.dll) created in .net that contains structures declared in a class as follows


VB Code:
Class MyClass Structure MySubStructure Dim Member1 as Integer End Structure  Structure MyStructure Dim Member2 as MySubStructure End Structure



When I try to access Member1 in VB 6.0, i can't because the intellisense only detects up to MyStructure.
For eg when i type


VB Code:
MyDll.


, intellisense gives me


VB Code:
MyDll.MyStructure


When I type a . after MyDll.MyStructure like this


VB Code:
MyDll.MyStructure.


Intellisense does not give me anything.

I know this problem has got to do with some early binding problem mentioned in MSDN () but it only referred to Functions, Subs and Events. What about Structures?

Does anyone know? Thanks!

Text High-lighting And IntelliSense...
Now, does anyone know how to change the color of certains words in a list or array when they are typed into a textbox? Like when If Then or Else is highlighted in blue when you finish a line on VB.
Also, final question for now, How does an Intellisense system work, like when functions are completed for you automatically?

Thanks again!

Would You Use This Control? *Intellisense Update Page 2*
Hi,
 I'd like to hear some opinions on this control that I developed. I'd like to have it available to everyone as soon as possible. Source code won't be included as I'd like to finally have some program of mine out there commercially. Commercially isn't the best word since most likely it will be free but I want to call it my own. Over the years I've developed all kinds of programs, P2P programs, cd burners, but I never finish them. At least this is almost complete.            


The control is essentially a textbox with Intellisense built in (line numbering too) that is designed for programmers that are making programming related software. The programmer can create their own list of keywords. The reason why I created this is I have never seen a code for it, I've seen codes for autocomplete but nothing like this. I've seen some people discuss it, and I want to make it easy for programmers to impliment intellisense to their applications. It looks identical to the one in the Visual basic IDE.

Thought's would be greatly appreciated.

    



Edited by - xterra on 8/23/2005 4:12:48 PM

[WORD] IntelliSense Using Templates As Code Containers
Hi,

I've run into a problem that doesn't seem to be documented anywhere...

I've put part of my code in a dot file to which I set a reference from several Word add-ins that share its functionality.

The classes in the shared dot file (with the attribute PublicNotCreatable set) are instantiated through public functions inside a code module, because otherwise it's impossible to access them directly.

Now I'm working in one of these other addins that has a reference to the shared addin. When I declare a variable as a class of the shared addin, IntelliSense stops working and the code won't compile. I can only get around this using late binding, thus declaring my variable as a general object... However, I'd like to avoid this if possible, since IntelliSense won't work for the "external" objects either.

Has anyone a clue?

Regards,

Guillermo

Would It Be Feasible To Write/find An Intellisense Control?
here's the deal:
we have a minor part of our VB/Access 2000/SQL application which involves putting a lot of similar text into a text box.
I was wondering if there were any controls out there which worked with predictive text much in the same way as Microsoft's Intellisense (or how complicated it would be to code such a control)
i am pretty familiar with visual basic, however have no experience creating user controls, which puts me at dilemma, use someone's components, or make my own (which will probably take me a long time ).
any input on the topic would be appreciated (even input calling me a retard-hey, it might motivate me )

Problem With Classes Containing Properties As Classes
Here's a description:

I have a class called "Bed".
I have another class called "clsAlarmShort". This class has a string property called "Location".
The "Bed" class has a clsAlarmShort property called "almNow", as well as an integer property called "Duration".
(These were all created using the Class Builder Utility).


Within a procedure in a form module, I do the following:

Code:
Dim GeneralBed As Bed
Set GeneralBed = New Bed

If I then do this, then I have no problem:

Code:
GeneralBed.Duration = 42

However, if I try to work with the so-called subclass almNow, I have a problem:

Code:
GeneralBed.almNow.Location = "MyLocation"
I then get Runtime Error 91: Object variable or With block variable not set.

What am I doing wrong?

Accessing Classes Derived Within Other Classes
I hope someone can help me,

Here is my situation. I have defined classes A,B and C in clsMain.
Everything compiles, and the classes are available within the Project.

I need to have a script access these classes from clsMain.
I have been able to create new instances within the script, but the instances from
the program cannot see the data changes, big surprise there.

I have tried the obvious, SET x = CREATEOBJECT("MAIN.&lt;SUBCLASS&gt;.A")
but that didn't work.

Any help would be appreciated

Passing Classes As Arguments To Other Classes
I am not able to pass classes to other classes.

In Class1, put the code



public A as Byte





In Form1, put the code




private Sub Form_Load()

Dim X as new Class1
Dim Coll as new Collection

X.A=25

Coll.Add X

'BookMark1

X.A=6

Coll.Add X

End Sub





When I make "X.A=6", the value of the first item in the collection also becomes "6". So, at BookMark1, I added the statement "Set X=Nothing". Is that necessary, or have I made a mistake somewhere? I have the same problem whenever I pass Objects to another Object.

Deepak

How Can I Add Sub-classes And Sub-sub-classes? OOP Question.
For my game, I have quite a bit of items. Putting them all in one class would be confusing and putting them seperately in LOTS of different classes would look disorganized.

Is it possible to put subclasses within a class module?

Like:


X.weapon.axes.weaponA.damage = 20

The options for reaching my class would be very descriptive to show exactly which item it is:
1)
X.weapon
X.armor
X.item

2)
x.weapon.axes
x.weapon.bows
x.weapon.swords
x.weapon.maces
x.weapon.mauls

3)
x.weapon.axes.weaponA
x.weapon.axes.weaponB
x.weapon.axes.weaponC

4)
x.weapon.axes.weaponA.damage = 20
x.weapon.axes.weaponA.name = "Broad Axe"
x.weapon.axes.weaponA.cost = 1400


I need to be able to make variations too like:

x.weapon.swords.weaponG.name = "Great Sword"

x.armor.bodyarmor.armorD.defense = 300

Is this possible to make all these subclasses without making a huge load of class modules?

Any help would be appreciated! Thanks!

-Kronikle

Classes Creating Classes
If I define a class in a class module, can I create an instance of this same class from withing the module?

Classes
I am working on a class for my visual basic class. The assignment was to simulate a vending machine. Now I believe that all my coding inside of the class is done but I don't know how to start the form side.

here is the class code:

Code:
Option Explicit

Private Inventory(0 To 5) As Inventory 'types and quantity of soda is stored in the array
Private myMoneyEarned As Currency 'the total money inside the vending machine.
Private myMoneyEntered As Currency ' the total money entered in the machine before a selection is made.
Private mycurPrice As Currency 'price per can of soda
Private myChange As Currency 'this is the cnage given back
Private strDeposite As String
Private strMessage As String

Private Sub Class_Initialize()
curPrice = 0.75



Inventory(0).name = "Sprite"
Inventory(1).name = "Coke"
Inventory(2).name = "Pepsi"
Inventory(3).name = "Mountain Dew"
Inventory(4).name = "Orange Sunkist"
Inventory(5).name = "Grape Sunkist"

Inventory(0).quantity = 6
Inventory(1).quantity = 6
Inventory(2).quantity = 6
Inventory(3).quantity = 6
Inventory(4).quantity = 6
Inventory(5).quantity = 6



End Sub
Public Property Let myDeposit(money As Currency)
money = txtDeposit.Text
End Property
Public Property Get myDeposit() As Currency
money = myMoneyEarned
End Property
Public Function Deposite(MoneyEarned As Currency) As Currency
Select Case Deposit
Case 5, 10, 25
strDeposit = "You have entered " & myMoneyEntered & "cents."
strMessage = myMoneyEarned
Case 0.05, 0.1, 0.25
strDeposit = "You have entered " & myMoneyEntered & "cents."
strMessage = myMoneyEarned
Case Else
strMessage = "You have entered an invalid coin"
End Select

myMoneyEarned = myMoneyEarned + myMoneyEntered

End Function

Private Sub Class_Terminate()

MsgBox = myMoneyEarned
End Sub

Private Function SoldOut(Index As Integer) As Boolean
If Inventory(Index).quantity = O Then
SoldOut = True
Else
SoldOut = False
End If
End Function

Public Sub Sale(Index As Integer)
If myMoneyEntered < Price Then
strMessage = "Please enter more money."
Else
If SoldOut(Index) Then
strMessage = "Your selection is currently sold out." & vbNewLine & "Please make another selection."
Else
Inventory(Index).quantity = Inventory(Index).quantity - 1
myMoneyEarned = myMoneyEarned + mycurPrice
strMessage = "Enjoy your " & Inventory(Index) & "." & vbNewLine & "Here is your change."
If myMoneyEntered > curPrice Then
myChange = myMoneyEntered - myPrice
strMessage = "Your change is equal to " & myChage & "cents."
End If
End If
End If

End Sub
I have a control array for the different names held in the inventory array. and all my text boxes set to display the messages incoded in the class but other than that I have no clue how to code the form.

Help With CLASSES!!
I know the basic about classes, how they work and stuff's like thath but not how to make them,basicly just how to give an object thing's like a Human could have Hair = Brown, Eye's = Blue et.c...Any one think they could help me???

Classes
Is there a way to put a picture to a class?
Right now I am using 2 variables - one that is the image, the other one holds the information for that image (so I can have multiple objects, each one doing something else). Is there a way to make it so I only need one variable as the class, then store the picture AND the information in that class?

Sorry if that doesnt make any sense..

VB-Classes
I have a class called "Item".. then I did the following
Dim "something" as new Item
Dim "something2 as new item
So how can I count how many "somethings" I created?

It wil be much better if I could count like this
Dim apple as new item
Dim apple2 as new item
Dim banana as new item
"There is 2 apples and 1 banana"
Sounds hard!?


Punkrock on my veins..... ARRGGHHUU !

Classes In VBA
I am trying to make a class to help me with a project but I don't know the vba syntax and the help file isn't telling.
Can someone give me the code required to
[
Decalare a class with a single date member of type string in here, the class module.


]

{
Create an instance of above class, pass a value to the data member of the class, retrieve the value from the data member in the class and display the value through a msg box when command button Command0 is clicked in here, the form module


}

Classes In VBA
VBA Design Question:

I have developed a few object classes (.cls files) for talking to scientific data acquisition machines and sensors, and each one has a few forms that are shown from the object methods (for adjusting machine settings and such). Now I am developing some workbooks, which use these objects to pull data into Excel for analysis.

I'd like to have the benefits of traditional OOP here - encapsulation (i.e., developers of the workbooks don't have to see and don't muck-up the GBIB communications and I/O string parsing and such) and inheritance (i.e., have revisions/bug-fixes to the object classes be implemented in the workbooks using them).

However, as you probably know if you've read this far, the object classes and forms are stored within the workbook. Changes to the object class within one workbook will not affect others. As well, allowing the deleveloper access to the VBA project (adding buttons to sheets, building workbook-specific forms, etc) will mean the devloper can get to the object class code also.

My idea is to save the classes and global forms in a protected XLA file (Excel Add-In) and then have the higher-level workbooks open the add-in in Workbook_Open. Is there a problem with this? I've never messed with Add-Ins.

For now, this project is in-house, to be used only by Excel 2000. I am considering sale of these tools to other companies using the same instruments, and would like to protect the higher-level source code. Any input or suggestions is appreciated. Thanks in advance.

Sub Classes
In VBA, do sub-classes get declared the same way their parent classes do? I am creating mine by right-clicking on "modules" in the project explorer window and selecting "new class module"

Thanks,

Kyeohti

Classes
Hi,

I'm currently doing a DLL with four different classes. I just realized that, from a Class, I can't call a function that's in another Class. Is there a property to change to be able to do this or is it just plain impossible? It's weird though, I don't see why VB doesn't let you do that...

Edit:
Forget it, I just realized that I can create an instance of any class. But I think there should have been a way to call it directly.

Thanks for reading anyway

Classes In VB
hi everyone, I admit Im not the expert programmer. Ive done a lot of object orientated programming in JAVA, and ive done a lot of event driven programming in vb. However, Ive never created a class in vb. I got some examples and reading material, but havent had a chance to try it out yet, as Im not home.

Id just like to get a few things straight and would appreciate help / comments:

1) First u add a class module in vb and give it a name. (myClass)
2) then you code you procedures/functions and variable inside it.
3) then you declare a new variable in your main coding (this variable must be of type myClass)
4) Now your create a new instance of myCLass in this variable (with Set variable name = new myClass

is this right. should I now have a working class?

thanks everyone
d

VB Classes
Hi programmers,
I've been programming in VB for a long time but I've never done a CLASS. All I need to know is a bit of syntax and a couple of things only since I've been programming with JAVA and I got all the theory about classes. Can anyone post the correct syntax for creating a class?

Zillions of thanx!

OCX And Classes
Is it possible to use classes in OCX projects? I have a dialog project that I am converting to an Active X control, but it utilizes a class to do its core functionality. It works fine in my test project group, and it compiles successfully - even registers successfully. But when I try to use it, it either will not load into VB6, or it will give me an error regarding an unregister / unfound (I forget exactly, I am working on getting it to load again so I can recreate the error) class. I *think* the class in the project is the problem - or is this that something the project uses is not registered properly?



Thanks in advance!

VB 6 Classes
Is it possible to have constructors in vb 6. That is can i pass values to a class upon construction. Also is it possible to set initial values?

Classes
How do you write information to a class data. I have a custName property in a class, and I want to know how to write to it.

Thanks in advance,
MikeJ

Classes
I've avoided using classes in my programming mainly because I've always been able to accomplish what I needed without using them. However, now I would like to transfer several of my routines to classes. Could someone show me how to tranfer this simple routine to class?

frmdate.show vbmodal ' fires on the click event of buttonx


mydate = calendar1.value 'fires when user selects cmdok


I use frmdate whenever the user is trys to query the database with a date range. frmdate opens I capture the date the user selects and then use that variable to query the database.

Copyright 2005-08 www.BigResource.com, All rights reserved