OnButtonClick Event

[Top]  [Chapter]  [Previous]  [Next]

Member of WPDLLInt

Declaration C#

OnButtonClick(Object Sender, int Editor, IWPDllButton Def)


Declaration OCX

OnButtonClick(ByVal Editor As Long, ByVal Def As WPTDynInt.IWPDllButton)


This event is triggered when the user clicks on a button or menu. (new: works with all buttons, not only custom buttons).


Inside the event OnButtonClick event the property Disabled can be set to true to abort the execution of the default button action until the button is clicked the next time.

(The state of "disabled" cannot be permanently changed in OnButtonClick - this has to be done in OnUpdateGUI)


The interface IWPDllButton provides access to the properties of the button. Most important is property "Name" which can be set in the toolbar description.



Example VB6:


Private Sub WPDLLInt1_OnButtonClick(ByVal Editor As LongByVal Def As WPTDynInt.IWPDllButton)

   If Def.Name = "CreateNewWindow" Then

     LoadNewDoc ' implemented as public routine in 'Main.BAS'

   End If

End Sub


This code uses a new button created in the PCC file:





If you are using the Active-X and your developing system does not provide access to the interface passed as parameter, use instead either the property EventButton or Memo.TextCommandStr(33,...)





[idh_wpdllint_onbuttonclick.htm]    Copyright © 2007 by WPCubed GmbH