Message 1 of 3
internal command button events
Not applicable
01-03-2008
02:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
in an addin i have some userdefined buttons created.
-Create Buttondefinition with .add
-Create event sink
-Write a _onexcute sub
This works fine.
Now I Want to do same same with an internal command.
'buttons
Private oMyButton As Inventor.ButtonDefinition
oMyButton = oControlDefs.item("AppFilePrintCmd")
'connect the button event sink
AddHandler oMyButton.OnExecute, AddressOf
Me.MyButton_OnExecute
Private Sub MyButton_OnExecute(ByVal Context As NameValueMap)
'MsgBox("Hello")
end sub
The buttondfinition is ok.
I can access the properties of the builtin Command for example "DisplayName"
The event sink seems to be ok too.
No errors occurs.
But it seems, that the procedur Mybutton_onexecute
is not executed when the button gets a click.
So my question is, what is going wrong?
I suggest, that inventor does not execute this because an internal command cannot be overrided by user code.
But what can I do to get the information that the user clicks the button?
I want to do something before the command is executed
and then excute the command.
I my case I want to write a time stamp on a sheet before
the AppFilePrintCmd Command is executed.
Manfred
in an addin i have some userdefined buttons created.
-Create Buttondefinition with .add
-Create event sink
-Write a _onexcute sub
This works fine.
Now I Want to do same same with an internal command.
'buttons
Private oMyButton As Inventor.ButtonDefinition
oMyButton = oControlDefs.item("AppFilePrintCmd")
'connect the button event sink
AddHandler oMyButton.OnExecute, AddressOf
Me.MyButton_OnExecute
Private Sub MyButton_OnExecute(ByVal Context As NameValueMap)
'MsgBox("Hello")
end sub
The buttondfinition is ok.
I can access the properties of the builtin Command for example "DisplayName"
The event sink seems to be ok too.
No errors occurs.
But it seems, that the procedur Mybutton_onexecute
is not executed when the button gets a click.
So my question is, what is going wrong?
I suggest, that inventor does not execute this because an internal command cannot be overrided by user code.
But what can I do to get the information that the user clicks the button?
I want to do something before the command is executed
and then excute the command.
I my case I want to write a time stamp on a sheet before
the AppFilePrintCmd Command is executed.
Manfred