event ScrollButtonClick (ScrollBar as ScrollBarEnum, ScrollPart as ScrollPartEnum)
Occurs when the user clicks a button in the scrollbar.

 TypeDescription 
   ScrollBar as ScrollBarEnum A ScrollBarEnum expression that specifies the scrollbar being clicked.  
   ScrollPart as ScrollPartEnum A ScrollPartEnum expression that indicates the part of the scroll being clicked.  
Use the ScrollButtonClick event to notify your application that the user clicks a button in the control's scrollbar. The ScrollButtonClick event is fired when the user clicks and releases the mouse over an enabled part of the scroll bar. Use the ScrollBars property to specify the visible scrollbars in the control. Use the ScrollPartVisible property to add or remove buttons/parts in the control's scrollbar. Use the ScrollPartEnable property to specify enable or disable parts in the control's scrollbar. Use the ScrolPartCaption property to specify the caption of the scroll's part. Use the Background property to change the visual appearance for any part in the control's scroll bar.

The following VB sample displays the identifier of the scroll's button being clicked:

With Edit1
        .ScrollPartVisible(exVScroll, exLeftB1Part Or exRightB1Part) = True
        .ScrollPartCaption(exVScroll, exLeftB1Part) = "1"
        .ScrollPartCaption(exVScroll, exRightB1Part) = "2"
End With
Private Sub Edit1_ScrollButtonClick(ByVal ScrollPart As EXEDITLibCtl.ScrollPartEnum)
    MsgBox (ScrollPart)
End Sub

The following VB.NET sample displays the identifier of the scroll's button being clicked:

With AxEdit1
    .set_ScrollPartVisible(EXEDITLib.ScrollBarEnum.exVScroll, EXEDITLib.ScrollPartEnum.exLeftB1Part Or EXEDITLib.ScrollPartEnum.exRightB1Part, True)
    .set_ScrollPartCaption(EXEDITLib.ScrollBarEnum.exVScroll, EXEDITLib.ScrollPartEnum.exLeftB1Part, "1")
    .set_ScrollPartCaption(EXEDITLib.ScrollBarEnum.exVScroll, EXEDITLib.ScrollPartEnum.exRightB1Part, "2")
End With
Private Sub AxEdit1_ScrollButtonClick(ByVal sender As System.Object, ByVal e As AxEXEDITLib._IEditEvents_ScrollButtonClickEvent) Handles AxEdit1.ScrollButtonClick
        MessageBox.Show( e.scrollPart.ToString())
End Sub

The following C# sample displays the identifier of the scroll's button being clicked:

axEdit1.set_ScrollPartVisible(EXEDITLib.ScrollBarEnum.exVScroll, EXEDITLib.ScrollPartEnum.exLeftB1Part | EXEDITLib.ScrollPartEnum.exRightB1Part, true);
axEdit1.set_ScrollPartCaption(EXEDITLib.ScrollBarEnum.exVScroll, EXEDITLib.ScrollPartEnum.exLeftB1Part , "1");
axEdit1.set_ScrollPartCaption(EXEDITLib.ScrollBarEnum.exVScroll, EXEDITLib.ScrollPartEnum.exRightB1Part, "2");
private void axEdit1_ScrollButtonClick(object sender, AxEXEDITLib._IEditEvents_ScrollButtonClickEvent e)
{
    MessageBox.Show(e.scrollPart.ToString());
}

The following C++ sample displays the identifier of the scroll's button being clicked:

m_edit.SetScrollPartVisible( 0 /*exVScroll*/, 32768  /*exLeftB1Part*/ | 32 /*exRightB1Part*/, TRUE );
m_edit.SetScrollPartCaption( 0 /*exVScroll*/, 32768  /*exLeftB1Part*/ , _T("1") );
m_edit.SetScrollPartCaption( 0 /*exVScroll*/, 32 /*exRightB1Part*/ , _T("2") );
void OnScrollButtonClickEdit1(long ScrollPart) 
{
	CString strFormat;
	strFormat.Format( _T("%i"), ScrollPart );
	MessageBox( strFormat );
}

The following VFP sample displays the identifier of the scroll's button being clicked:

With thisform.Edit1
        .ScrollPartVisible(0, bitor(32768,32)) = .t.
        .ScrollPartCaption(0,32768) = "1"
        .ScrollPartCaption(0, 32) = "2"
EndWit
 
Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.