event QueryContext (XCursor as Long, YCursor as Long, ByRef QContext as Variant)
Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.

TypeDescription
XCursor as Long A Long expression that specifies the position of the caret inside the current line.
YCursor as Long A Long expression that specifies the position current line.
QContext as Variant (By Reference) A String expression that defines the context to be passed to the QContext parameter of the QueryContextToolTip event.
The QueryContext event queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event. For instance, the QueryContext event occurs when the control is about to find / display the tooltip of the keyword from the cursor. Use the QueryContextToolTip event to define a new tooltip to be shown for specified context.

 

Syntax for QueryContext event, /NET version, on:

private void QueryContext(object sender,int   XCursor,int   YCursor,ref object   QContext)
{
}

Private Sub QueryContext(ByVal sender As System.Object,ByVal XCursor As Integer,ByVal YCursor As Integer,ByRef QContext As Object) Handles QueryContext
End Sub

Syntax for QueryContext event, /COM version, on:

private void QueryContext(object sender, AxEXEDITLib._IEditEvents_QueryContextEvent e)
{
}

void OnQueryContext(long   XCursor,long   YCursor,VARIANT FAR*   QContext)
{
}

void __fastcall QueryContext(TObject *Sender,long   XCursor,long   YCursor,Variant *   QContext)
{
}

procedure QueryContext(ASender: TObject; XCursor : Integer;YCursor : Integer;var QContext : OleVariant);
begin
end;

procedure QueryContext(sender: System.Object; e: AxEXEDITLib._IEditEvents_QueryContextEvent);
begin
end;

begin event QueryContext(long  XCursor,long  YCursor,any  QContext)

end event QueryContext

Private Sub QueryContext(ByVal sender As System.Object, ByVal e As AxEXEDITLib._IEditEvents_QueryContextEvent) Handles QueryContext
End Sub

Private Sub QueryContext(ByVal XCursor As Long,ByVal YCursor As Long,QContext As Variant)
End Sub

Private Sub QueryContext(ByVal XCursor As Long,ByVal YCursor As Long,QContext As Variant)
End Sub

LPARAMETERS XCursor,YCursor,QContext

PROCEDURE OnQueryContext(oEdit,XCursor,YCursor,QContext)

RETURN

Syntax for QueryContext event, /COM version (others), on:

<SCRIPT EVENT="QueryContext(XCursor,YCursor,QContext)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function QueryContext(XCursor,YCursor,QContext)
End Function
</SCRIPT>

Procedure OnComQueryContext Integer   llXCursor Integer   llYCursor Variant   llQContext
	Forward Send OnComQueryContext llXCursor llYCursor llQContext
End_Procedure

METHOD OCX_QueryContext(XCursor,YCursor,QContext) CLASS MainDialog
RETURN NIL

void onEvent_QueryContext(int   _XCursor,int   _YCursor,COMVariant /*variant*/   _QContext)
{
}

function QueryContext as v (XCursor  as  N,YCursor  as  N,QContext  as  A)
end function

function nativeObject_QueryContext(XCursor,YCursor,QContext)
return

How can I provide different tooltip for the same keyword?

VBA (MS Access, Excell...)

' QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
Private Sub Edit1_QueryContext(ByVal XCursor As Long,ByVal YCursor As Long,QContext As Variant)
	With Edit1
		QContext = YCursor
	End With
End Sub

' QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
Private Sub Edit1_QueryContextToolTip(ByVal QContext As String,ByVal Keyword As String,QToolTip As Variant,QToolTipTitle As Variant)
	With Edit1
		QToolTip = QContext
		QToolTipTitle = "Keyword Found At Line:"
	End With
End Sub

With Edit1
	.LineNumberWidth = -1
	.LineNumberBackColor = RGB(240,240,240)
	.AddKeyword "<fgcolor=FF0000><b>keyword</b></fgcolor>"
	.Text = ""
	.InsertText "here's the keyword on the first line"
	.InsertText "\r\nhere's the keyword on the second line"
	.InsertText "\r\nhere's the keyword on the third line"
End With

VB6

' QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
Private Sub Edit1_QueryContext(ByVal XCursor As Long,ByVal YCursor As Long,QContext As Variant)
	With Edit1
		QContext = YCursor
	End With
End Sub

' QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
Private Sub Edit1_QueryContextToolTip(ByVal QContext As String,ByVal Keyword As String,QToolTip As Variant,QToolTipTitle As Variant)
	With Edit1
		QToolTip = QContext
		QToolTipTitle = "Keyword Found At Line:"
	End With
End Sub

With Edit1
	.LineNumberWidth = -1
	.LineNumberBackColor = RGB(240,240,240)
	.AddKeyword "<fgcolor=FF0000><b>keyword</b></fgcolor>"
	.Text = ""
	.InsertText "here's the keyword on the first line"
	.InsertText "\r\nhere's the keyword on the second line"
	.InsertText "\r\nhere's the keyword on the third line"
End With

VB.NET

' QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
Private Sub Exedit1_QueryContext(ByVal sender As System.Object,ByVal XCursor As Integer,ByVal YCursor As Integer,ByRef QContext As Object) Handles Exedit1.QueryContext
	With Exedit1
		QContext = YCursor
	End With
End Sub

' QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
Private Sub Exedit1_QueryContextToolTip(ByVal sender As System.Object,ByVal QContext As String,ByVal Keyword As String,ByRef QToolTip As Object,ByRef QToolTipTitle As Object) Handles Exedit1.QueryContextToolTip
	With Exedit1
		QToolTip = QContext
		QToolTipTitle = "Keyword Found At Line:"
	End With
End Sub

With Exedit1
	.LineNumberWidth = -1
	.LineNumberBackColor = Color.FromArgb(240,240,240)
	.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>")
	.Text = ""
	.InsertText("here's the keyword on the first line")
	.InsertText("\r\nhere's the keyword on the second line")
	.InsertText("\r\nhere's the keyword on the third line")
End With

VB.NET for /COM

' QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
Private Sub AxEdit1_QueryContext(ByVal sender As System.Object, ByVal e As AxEXEDITLib._IEditEvents_QueryContextEvent) Handles AxEdit1.QueryContext
	With AxEdit1
		e.qContext = e.yCursor
	End With
End Sub

' QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
Private Sub AxEdit1_QueryContextToolTip(ByVal sender As System.Object, ByVal e As AxEXEDITLib._IEditEvents_QueryContextToolTipEvent) Handles AxEdit1.QueryContextToolTip
	With AxEdit1
		e.qToolTip = e.qContext
		e.qToolTipTitle = "Keyword Found At Line:"
	End With
End Sub

With AxEdit1
	.LineNumberWidth = -1
	.LineNumberBackColor = RGB(240,240,240)
	.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>")
	.Text = ""
	.InsertText("here's the keyword on the first line")
	.InsertText("\r\nhere's the keyword on the second line")
	.InsertText("\r\nhere's the keyword on the third line")
End With

C++

// QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
void OnQueryContextEdit1(long   XCursor,long   YCursor,VARIANT FAR*   QContext)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXEDITLib' for the library: 'ExEdit 1.0 Control Library'
		#import <ExEdit.dll>
		using namespace EXEDITLib;
	*/
	EXEDITLib::IEditPtr spEdit1 = GetDlgItem(IDC_EDIT1)->GetControlUnknown();
	QContext = YCursor;
}

// QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
void OnQueryContextToolTipEdit1(LPCTSTR   QContext,LPCTSTR   Keyword,VARIANT FAR*   QToolTip,VARIANT FAR*   QToolTipTitle)
{
	EXEDITLib::IEditPtr spEdit1 = GetDlgItem(IDC_EDIT1)->GetControlUnknown();
	QToolTip = QContext;
	QToolTipTitle = "Keyword Found At Line:";
}

EXEDITLib::IEditPtr spEdit1 = GetDlgItem(IDC_EDIT1)->GetControlUnknown();
spEdit1->PutLineNumberWidth(-1);
spEdit1->PutLineNumberBackColor(RGB(240,240,240));
spEdit1->AddKeyword(L"<fgcolor=FF0000><b>keyword</b></fgcolor>",vtMissing,vtMissing,vtMissing);
spEdit1->PutText(L"");
spEdit1->InsertText(L"here's the keyword on the first line",vtMissing);
spEdit1->InsertText(L"\\r\\nhere's the keyword on the second line",vtMissing);
spEdit1->InsertText(L"\\r\\nhere's the keyword on the third line",vtMissing);

C++ Builder

// QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
void __fastcall TForm1::Edit1QueryContext(TObject *Sender,long   XCursor,long   YCursor,Variant *   QContext)
{
	QContext = YCursor;
}

// QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
void __fastcall TForm1::Edit1QueryContextToolTip(TObject *Sender,BSTR   QContext,BSTR   Keyword,Variant *   QToolTip,Variant *   QToolTipTitle)
{
	QToolTip = QContext;
	QToolTipTitle = "Keyword Found At Line:";
}

Edit1->LineNumberWidth = -1;
Edit1->LineNumberBackColor = RGB(240,240,240);
Edit1->AddKeyword(L"<fgcolor=FF0000><b>keyword</b></fgcolor>",TNoParam(),TNoParam(),TNoParam());
Edit1->Text = L"";
Edit1->InsertText(L"here's the keyword on the first line",TNoParam());
Edit1->InsertText(L"\\r\\nhere's the keyword on the second line",TNoParam());
Edit1->InsertText(L"\\r\\nhere's the keyword on the third line",TNoParam());

C#

// QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
private void exedit1_QueryContext(object sender,int   XCursor,int   YCursor,ref object   QContext)
{
	QContext = YCursor;
}
//this.exedit1.QueryContext += new exontrol.EXEDITLib.exg2antt.QueryContextEventHandler(this.exedit1_QueryContext);

// QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
private void exedit1_QueryContextToolTip(object sender,string   QContext,string   Keyword,ref object   QToolTip,ref object   QToolTipTitle)
{
	QToolTip = QContext;
	QToolTipTitle = "Keyword Found At Line:";
}
//this.exedit1.QueryContextToolTip += new exontrol.EXEDITLib.exg2antt.QueryContextToolTipEventHandler(this.exedit1_QueryContextToolTip);

exedit1.LineNumberWidth = -1;
exedit1.LineNumberBackColor = Color.FromArgb(240,240,240);
exedit1.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>",null,null,null);
exedit1.Text = "";
exedit1.InsertText("here's the keyword on the first line",null);
exedit1.InsertText("\\r\\nhere's the keyword on the second line",null);
exedit1.InsertText("\\r\\nhere's the keyword on the third line",null);

JScript/JavaScript

<BODY onload="Init()">
<SCRIPT FOR="Edit1" EVENT="QueryContext(XCursor,YCursor,QContext)" LANGUAGE="JScript">
	QContext = YCursor;
</SCRIPT>

<SCRIPT FOR="Edit1" EVENT="QueryContextToolTip(QContext,Keyword,QToolTip,QToolTipTitle)" LANGUAGE="JScript">
	QToolTip = QContext;
	QToolTipTitle = "Keyword Found At Line:";
</SCRIPT>

<OBJECT CLASSID="clsid:39136531-DD0F-4281-B445-E36FC2CDDBC5" id="Edit1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	Edit1.LineNumberWidth = -1;
	Edit1.LineNumberBackColor = 15790320;
	Edit1.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>",null,null,null);
	Edit1.Text = "";
	Edit1.InsertText("here's the keyword on the first line",null);
	Edit1.InsertText("\\r\\nhere's the keyword on the second line",null);
	Edit1.InsertText("\\r\\nhere's the keyword on the third line",null);
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<SCRIPT LANGUAGE="VBScript">
Function Edit1_QueryContext(XCursor,YCursor,QContext)
	With Edit1
		QContext = YCursor
	End With
End Function
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function Edit1_QueryContextToolTip(QContext,Keyword,QToolTip,QToolTipTitle)
	With Edit1
		QToolTip = QContext
		QToolTipTitle = "Keyword Found At Line:"
	End With
End Function
</SCRIPT>

<OBJECT CLASSID="clsid:39136531-DD0F-4281-B445-E36FC2CDDBC5" id="Edit1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With Edit1
		.LineNumberWidth = -1
		.LineNumberBackColor = RGB(240,240,240)
		.AddKeyword "<fgcolor=FF0000><b>keyword</b></fgcolor>"
		.Text = ""
		.InsertText "here's the keyword on the first line"
		.InsertText "\r\nhere's the keyword on the second line"
		.InsertText "\r\nhere's the keyword on the third line"
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

// QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
private void axEdit1_QueryContext(object sender, AxEXEDITLib._IEditEvents_QueryContextEvent e)
{
	e.qContext = e.yCursor;
}
//this.axEdit1.QueryContext += new AxEXEDITLib._IEditEvents_QueryContextEventHandler(this.axEdit1_QueryContext);

// QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
private void axEdit1_QueryContextToolTip(object sender, AxEXEDITLib._IEditEvents_QueryContextToolTipEvent e)
{
	e.qToolTip = e.qContext;
	e.qToolTipTitle = "Keyword Found At Line:";
}
//this.axEdit1.QueryContextToolTip += new AxEXEDITLib._IEditEvents_QueryContextToolTipEventHandler(this.axEdit1_QueryContextToolTip);

axEdit1.LineNumberWidth = -1;
axEdit1.LineNumberBackColor = Color.FromArgb(240,240,240);
axEdit1.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>",null,null,null);
axEdit1.Text = "";
axEdit1.InsertText("here's the keyword on the first line",null);
axEdit1.InsertText("\\r\\nhere's the keyword on the second line",null);
axEdit1.InsertText("\\r\\nhere's the keyword on the third line",null);

X++ (Dynamics Ax 2009)

// QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
void onEvent_QueryContext(int   _XCursor,int   _YCursor,COMVariant /*variant*/   _QContext)
{
	;
	_QContext = _YCursor;
}

// QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
void onEvent_QueryContextToolTip(str   _QContext,str   _Keyword,COMVariant /*variant*/   _QToolTip,COMVariant /*variant*/   _QToolTipTitle)
{
	;
	_QToolTip = _QContext;
	_QToolTipTitle = "Keyword Found At Line:";
}

public void init()
{
	;

	super();

	exedit1.LineNumberWidth(-1);
	exedit1.LineNumberBackColor(WinApi::RGB2int(240,240,240));
	exedit1.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>");
	exedit1.Text("");
	exedit1.InsertText("here's the keyword on the first line");
	exedit1.InsertText("\\r\\nhere's the keyword on the second line");
	exedit1.InsertText("\\r\\nhere's the keyword on the third line");
}

Delphi 8 (.NET only)

// QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
procedure TWinForm1.AxEdit1_QueryContext(sender: System.Object; e: AxEXEDITLib._IEditEvents_QueryContextEvent);
begin
	with AxEdit1 do
	begin
		e.qContext := e.yCursor;
	end
end;

// QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
procedure TWinForm1.AxEdit1_QueryContextToolTip(sender: System.Object; e: AxEXEDITLib._IEditEvents_QueryContextToolTipEvent);
begin
	with AxEdit1 do
	begin
		e.qToolTip := e.qContext;
		e.qToolTipTitle := 'Keyword Found At Line:';
	end
end;

with AxEdit1 do
begin
	LineNumberWidth := -1;
	LineNumberBackColor := Color.FromArgb(240,240,240);
	AddKeyword('<fgcolor=FF0000><b>keyword</b></fgcolor>',Nil,Nil,Nil);
	Text := '';
	InsertText('here''s the keyword on the first line',Nil);
	InsertText('\r\nhere''s the keyword on the second line',Nil);
	InsertText('\r\nhere''s the keyword on the third line',Nil);
end

Delphi (standard)

// QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
procedure TForm1.Edit1QueryContext(ASender: TObject; XCursor : Integer;YCursor : Integer;var QContext : OleVariant);
begin
	with Edit1 do
	begin
		QContext := YCursor;
	end
end;

// QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
procedure TForm1.Edit1QueryContextToolTip(ASender: TObject; QContext : WideString;Keyword : WideString;var QToolTip : OleVariant;var QToolTipTitle : OleVariant);
begin
	with Edit1 do
	begin
		QToolTip := QContext;
		QToolTipTitle := 'Keyword Found At Line:';
	end
end;

with Edit1 do
begin
	LineNumberWidth := -1;
	LineNumberBackColor := RGB(240,240,240);
	AddKeyword('<fgcolor=FF0000><b>keyword</b></fgcolor>',Null,Null,Null);
	Text := '';
	InsertText('here''s the keyword on the first line',Null);
	InsertText('\r\nhere''s the keyword on the second line',Null);
	InsertText('\r\nhere''s the keyword on the third line',Null);
end

VFP

*** QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event. ***
LPARAMETERS XCursor,YCursor,QContext
	with thisform.Edit1
		QContext = YCursor
	endwith

*** QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event. ***
LPARAMETERS QContext,Keyword,QToolTip,QToolTipTitle
	with thisform.Edit1
		QToolTip = QContext
		QToolTipTitle = "Keyword Found At Line:"
	endwith

with thisform.Edit1
	.LineNumberWidth = -1
	.LineNumberBackColor = RGB(240,240,240)
	.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>")
	.Text = ""
	.InsertText("here's the keyword on the first line")
	.InsertText("\r\nhere's the keyword on the second line")
	.InsertText("\r\nhere's the keyword on the third line")
endwith

dBASE Plus

/*
with (this.EXEDITACTIVEXCONTROL1.nativeObject)
	QueryContext = class::nativeObject_QueryContext
endwith
*/
// Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
function nativeObject_QueryContext(XCursor,YCursor,QContext)
	oEdit = form.EXEDITACTIVEXCONTROL1.nativeObject
	QContext = YCursor
return

/*
with (this.EXEDITACTIVEXCONTROL1.nativeObject)
	QueryContextToolTip = class::nativeObject_QueryContextToolTip
endwith
*/
// Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
function nativeObject_QueryContextToolTip(QContext,Keyword,QToolTip,QToolTipTitle)
	oEdit = form.EXEDITACTIVEXCONTROL1.nativeObject
	QToolTip = QContext
	QToolTipTitle = "Keyword Found At Line:"
return

local oEdit

oEdit = form.EXEDITACTIVEXCONTROL1.nativeObject
oEdit.LineNumberWidth = -1
oEdit.LineNumberBackColor = 0xf0f0f0
oEdit.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>")
oEdit.Text = ""
oEdit.InsertText("here's the keyword on the first line")
oEdit.InsertText("\r\nhere's the keyword on the second line")
oEdit.InsertText("\r\nhere's the keyword on the third line")

XBasic (Alpha Five)

' Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
function QueryContext as v (XCursor  as  N,YCursor  as  N,QContext  as  A)
	oEdit = topparent:CONTROL_ACTIVEX1.activex
	QContext = YCursor
end function

' Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
function QueryContextToolTip as v (QContext  as  C,Keyword  as  C,QToolTip  as  A,QToolTipTitle  as  A)
	oEdit = topparent:CONTROL_ACTIVEX1.activex
	QToolTip = QContext
	QToolTipTitle = "Keyword Found At Line:"
end function

Dim oEdit as P

oEdit = topparent:CONTROL_ACTIVEX1.activex
oEdit.LineNumberWidth = -1
oEdit.LineNumberBackColor = 15790320
oEdit.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>")
oEdit.Text = ""
oEdit.InsertText("here's the keyword on the first line")
oEdit.InsertText("\r\nhere's the keyword on the second line")
oEdit.InsertText("\r\nhere's the keyword on the third line")

Visual Objects

METHOD OCX_Exontrol1QueryContext(XCursor,YCursor,QContext) CLASS MainDialog
	// QueryContext event - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
	QContext := YCursor
RETURN NIL

METHOD OCX_Exontrol1QueryContextToolTip(QContext,Keyword,QToolTip,QToolTipTitle) CLASS MainDialog
	// QueryContextToolTip event - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
	QToolTip := QContext
	QToolTipTitle := "Keyword Found At Line:"
RETURN NIL


oDCOCX_Exontrol1:LineNumberWidth := -1
oDCOCX_Exontrol1:LineNumberBackColor := RGB(240,240,240)
oDCOCX_Exontrol1:AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>",nil,nil,nil)
oDCOCX_Exontrol1:Text := ""
oDCOCX_Exontrol1:InsertText("here's the keyword on the first line",nil)
oDCOCX_Exontrol1:InsertText("\r\nhere's the keyword on the second line",nil)
oDCOCX_Exontrol1:InsertText("\r\nhere's the keyword on the third line",nil)

PowerBuilder

/*begin event QueryContext(long  XCursor,long  YCursor,any  QContext) - Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.*/
/*
	oEdit = ole_1.Object
	QContext = YCursor
*/
/*end event QueryContext*/

/*begin event QueryContextToolTip(string  QContext,string  Keyword,any  QToolTip,any  QToolTipTitle) - Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.*/
/*
	oEdit = ole_1.Object
	QToolTip = QContext
	QToolTipTitle = "Keyword Found At Line:"
*/
/*end event QueryContextToolTip*/

OleObject oEdit

oEdit = ole_1.Object
oEdit.LineNumberWidth = -1
oEdit.LineNumberBackColor = RGB(240,240,240)
oEdit.AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>")
oEdit.Text = ""
oEdit.InsertText("here's the keyword on the first line")
oEdit.InsertText("\r\nhere's the keyword on the second line")
oEdit.InsertText("\r\nhere's the keyword on the third line")

Visual DataFlex

// Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.
Procedure OnComQueryContext Integer   llXCursor Integer   llYCursor Variant   llQContext
	Forward Send OnComQueryContext llXCursor llYCursor llQContext
	Move llYCursor to QContext
End_Procedure

// Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.
Procedure OnComQueryContextToolTip String   llQContext String   llKeyword Variant   llQToolTip Variant   llQToolTipTitle
	Forward Send OnComQueryContextToolTip llQContext llKeyword llQToolTip llQToolTipTitle
	Move llQContext to QToolTip
	Move "Keyword Found At Line:" to QToolTipTitle
End_Procedure

Procedure OnCreate
	Forward Send OnCreate
	Set ComLineNumberWidth to -1
	Set ComLineNumberBackColor to (RGB(240,240,240))
	Send ComAddKeyword "<fgcolor=FF0000><b>keyword</b></fgcolor>" Nothing Nothing Nothing
	Set ComText to ""
	Send ComInsertText "here's the keyword on the first line" Nothing
	Send ComInsertText "\r\nhere's the keyword on the second line" Nothing
	Send ComInsertText "\r\nhere's the keyword on the third line" Nothing
End_Procedure

XBase++

PROCEDURE OnQueryContext(oEdit,XCursor,YCursor,QContext)
	QContext := YCursor
RETURN

PROCEDURE OnQueryContextToolTip(oEdit,QContext,Keyword,QToolTip,QToolTipTitle)
	QToolTip := QContext
	QToolTipTitle := "Keyword Found At Line:"
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oEdit

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oEdit := XbpActiveXControl():new( oForm:drawingArea )
	oEdit:CLSID  := "Exontrol.Edit.1" /*{39136531-DD0F-4281-B445-E36FC2CDDBC5}*/
	oEdit:create(,, {10,60},{610,370} )

		oEdit:QueryContext := {|XCursor,YCursor,QContext| OnQueryContext(oEdit,XCursor,YCursor,QContext)} /*Queries for the context at the specified location, to provide different tooltips for the same keyword on QueryContextToolTip event.*/
		oEdit:QueryContextToolTip := {|QContext,Keyword,QToolTip,QToolTipTitle| OnQueryContextToolTip(oEdit,QContext,Keyword,QToolTip,QToolTipTitle)} /*Asks for the tooltip/title of the keyword on the context retrieved by the QueryContext event.*/

		oEdit:LineNumberWidth := -1
		oEdit:SetProperty("LineNumberBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oEdit:AddKeyword("<fgcolor=FF0000><b>keyword</b></fgcolor>")
		oEdit:Text := ""
		oEdit:InsertText("here's the keyword on the first line")
		oEdit:InsertText("\r\nhere's the keyword on the second line")
		oEdit:InsertText("\r\nhere's the keyword on the third line")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN