Mehrere Instanzen von CodeSense

StrongSoul

Grünschnabel
Hallo iebe VB'ler,

ich habe da ein Problem mit einem CodeSense Steuerelement.

Und zwar möchte ich mehrere Instanzen davon öffnen, also habe ich ein Control Array daraus gemacht.

Das Element hat denNamen cs

Leider führt das zu komplikationen zu den dazugehörigen Funktionen.
Sobald ich das Programm ausführen möchte, bekomme ich folgende Fehlermeldung:
Compile Error:
Procedure declaration does not match description of event or procedure having the same name


dabei markiert er mir folgende Zeile:
Code:
Private Function cs_CodeList(ByVal Control As CodeSenseCtl.ICodeSense, ByVal ListCtrl As CodeSenseCtl.ICodeList) As Boolean

Aus folgedem Code
Code:
Option Explicit

'Everything below is a wrapper to our functions, in
'the modAutoCompleteToolTip module
Private Function cs_CodeList(ByVal Control As CodeSenseCtl.ICodeSense, ByVal ListCtrl As CodeSenseCtl.ICodeList) As Boolean
    cs_CodeList = CodeList(Control, ListCtrl, imlPopup)
End Function

Private Function cs_CodeListSelMade(ByVal Control As CodeSenseCtl.ICodeSense, ByVal ListCtrl As CodeSenseCtl.ICodeList) As Boolean
    cs_CodeListSelMade = CodeListSelMade(Control, ListCtrl)
End Function

'cs_CodeListSelWord ---
' Tells CodeSense control to allow itself to choose
' word most like the current word
Private Function cs_CodeListSelWord(ByVal Control As CodeSenseCtl.ICodeSense, ByVal ListCtrl As CodeSenseCtl.ICodeList, ByVal lItem As Long) As Boolean
    cs_CodeListSelWord = True
End Function

Private Function cs_CodeTip(ByVal Control As CodeSenseCtl.ICodeSense) As CodeSenseCtl.cmToolTipType
    cs_CodeTip = CodeTip(Control)
End Function

Private Sub cs_CodeTipInitialize(ByVal Control As CodeSenseCtl.ICodeSense, ByVal ToolTipCtrl As CodeSenseCtl.ICodeTip)
    CodeTipInitialize Control, ToolTipCtrl
End Sub

Private Sub cs_CodeTipUpdate(ByVal Control As CodeSenseCtl.ICodeSense, ByVal ToolTipCtrl As CodeSenseCtl.ICodeTip)
    CodeTipUpdate Control, ToolTipCtrl
End Sub

Private Function cs_KeyPress(ByVal Control As CodeSenseCtl.ICodeSense, ByVal KeyAscii As Long, ByVal Shift As Long) As Boolean
    cs_KeyPress = KeyPress(Control, KeyAscii, Shift)
End Function
'end wrappers

'use this to print (into the immediate window) any
'keys that are pressed
Private Function cs_KeyDown(ByVal Control As CodeSenseCtl.ICodeSense, ByVal KeyCode As Long, ByVal Shift As Long) As Boolean
    Debug.Print KeyCode, GetKeyMaskName(CByte(Shift)); GetVirtKeyName(KeyCode)
End Function


'Form_Load ---
' Called when program starts
Private Sub Form_Load()
Me.Show
'disable text box
cs(0).Enabled = False
Dim objTempLang As New Language
'show loading message
mnuLoading.Caption = "Setting up defaults..."
'set colors for line numbers on side
cs(0).SetColor cmClrLineNumberBk, RGB(128, 128, 128)
cs(0).SetColor cmClrLineNumber, vbBlack
'make the properties of this CodeSense control
'the same for all of them in this program
cs(0).GlobalProps = True

mnuLoading.Caption = "Initializing AutoComplete / ToolTips..."
'initialize AutoComplete and ToolTip-thingy
Call InitializeFuncs

mnuLoading.Caption = "Initializing Syntax highlighting..."
'get the definition for Basic
Set objTempLang = CSGlobals.GetLanguageDef("Basic")
'get rid of all languages
CSGlobals.UnregisterAllLanguages
'fix up basic definition
objTempLang.ScopeKeywords1 = objTempLang.ScopeKeywords1 & vbLf & "Sub"
objTempLang.ScopeKeywords2 = objTempLang.ScopeKeywords2 & vbLf & "End Sub"
objTempLang.Keywords = FuncString
'register language (DanProgrammer VBScript)...

mnuLoading.Caption = ""
mnuLoading.Visible = False
cs(0).Enabled = True
End Sub

Ich muss dazu sagen, dass mein Projekt auf ein Beispielprojekt beruht, dort war das CodeSense Element nicht in einem Control Array.

Wie kann ich es machen, dass die Funktionen für jedes Control Array wirken und das ich keine Fehlermeldung mehr bekomme?

Gruss
Soul
 
Zurück