event BookmarkChange (Index as Long)
Occurs when the user adds or removes bookmarks.

 TypeDescription 
   Index as Long A long expression that indicates the line being changed.  

The BokmarkChange event notifies your application that user changes the line's bookmark. The BookmarkWidth property specifies whether the bookmarks header is visible or hidden. The Bookmark property specifies whether a line has a bookmark. The BookmarksList property specifies the lines with bookmarks. Use the TextLine property to retrieve a line by its index. Use the NextBookmark method to move the cursor to the next bookmark. Use the PrevBookmark method to move the cursor to the prior bookmark.

Syntax for BookmarkChange event, /NET version, on:

private void BookmarkChange(object sender,int Index)
{
}

Private Sub BookmarkChange(ByVal sender As System.Object,ByVal Index As Integer) Handles BookmarkChange
End Sub

Syntax for BookmarkChange event, /COM version, on:

private void BookmarkChange(object sender, AxEXEDITLib._IEditEvents_BookmarkChangeEvent e)
{
}

void OnBookmarkChange(long Index)
{
}

void __fastcall BookmarkChange(TObject *Sender,long Index)
{
}

procedure BookmarkChange(ASender: TObject; Index : Integer);
begin
end;

procedure BookmarkChange(sender: System.Object; e: AxEXEDITLib._IEditEvents_BookmarkChangeEvent);
begin
end;

begin event BookmarkChange(long Index)
end event BookmarkChange

Private Sub BookmarkChange(ByVal sender As System.Object, ByVal e As AxEXEDITLib._IEditEvents_BookmarkChangeEvent) Handles BookmarkChange
End Sub

Private Sub BookmarkChange(ByVal Index As Long)
End Sub

Private Sub BookmarkChange(ByVal Index As Long)
End Sub

LPARAMETERS Index

PROCEDURE OnBookmarkChange(oEdit,Index)
RETURN

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

<SCRIPT EVENT="BookmarkChange(Index)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function BookmarkChange(Index)
End Function
</SCRIPT>

Procedure OnComBookmarkChange Integer llIndex
	Forward Send OnComBookmarkChange llIndex
End_Procedure

METHOD OCX_BookmarkChange(Index) CLASS MainDialog
RETURN NIL

void onEvent_BookmarkChange(int _Index)
{
}

function BookmarkChange as v (Index as N)
end function

function nativeObject_BookmarkChange(Index)
return

The following VB sample displays the lines with bookmarks:

Private Sub Edit1_BookmarkChange(ByVal Index As Long)
    With Edit1
        Dim i As Long, b As Variant
        b = .BookmarksList
        For i = LBound(b) To UBound(b)
            Debug.Print .TextLine(b(i))
        Next
    End With
End Sub

The following C++ sample displays the lines with bookmarks:

void OnBookmarkChangeEdit1(long Index) 
{
	COleVariant vtBookmarks = m_edit.GetBookmarksList();
	SAFEARRAY* pBookmarks = V_ARRAY( &vtBookmarks );
	long nDim = 0;
	for ( long i = pBookmarks->rgsabound[nDim].lLbound; i < (long)pBookmarks->rgsabound[nDim].cElements; i++ )
	{
		long nLine = 0;
		SafeArrayGetElement( pBookmarks, &i, &nLine );
		OutputDebugString( m_edit.GetTextLine( nLine ) );
	}
}

The following VB.NET sample displays the lines with bookmarks:

Private Sub AxEdit1_BookmarkChange(ByVal sender As Object, ByVal e As AxEXEDITLib._IEditEvents_BookmarkChangeEvent) Handles AxEdit1.BookmarkChange
    With AxEdit1
        Dim i As Integer, b As Integer() = .BookmarksList
        For Each i In b
            Debug.WriteLine(.get_TextLine(i))
        Next
    End With
End Sub

or

Private Sub AxEdit1_BookmarkChange(ByVal sender As Object, ByVal e As AxEXEDITLib._IEditEvents_BookmarkChangeEvent) Handles AxEdit1.BookmarkChange
    With AxEdit1
        Dim i As Long, b As Object
        b = .BookmarksList
        For i = LBound(b) To UBound(b)
            Debug.WriteLine(.get_TextLine(b(i)))
        Next
    End With
End Sub

The following C# sample displays the lines with bookmarks:

private void axEdit1_BookmarkChange(object sender, AxEXEDITLib._IEditEvents_BookmarkChangeEvent e)
{
	int[] b = axEdit1.BookmarksList as int[];
	foreach (int i in b)
		System.Diagnostics.Debug.WriteLine(axEdit1.get_TextLine(i));
}

The following VFP sample displays the lines with bookmarks:

*** ActiveX Control Event ***
LPARAMETERS index

with thisform.Edit1
	local b, i
	b = .BookmarksList
	for i = 1 to alen(b)
		wait window .TextLine(b[i])
	next
endwith

 


Send comments on this topic.
1999-2016 Exontrol.COM, Software. All rights reserved.