arivas_2005 Power User

Joined: 10 Oct 2006 Posts: 98 Location: El Salvador CentroAm
|
Posted: Thu May 01, 2008 10:32 am Post subject: Aisgn Macro to CommanButton |
|
|
Hi.
I have the macro. it creates the CommandButton with label "Stop Process" in Active Sheet
It is visible while a long process runs.
| Code: | Sub ShowButton3
oSheet = Thiscomponent.CurrentController.ActiveSheet
ControlBoton1 = Thiscomponent.createInstance("com.sun.star.drawing.ControlShape")
ControlBox1=Thiscomponent.createInstance("com.sun.star.form.component.CommandButton")
Dim oPos as new com.sun.star.awt.Point
oPos.X = 8000 : oPos.Y = 5000
ControlBoton1.setPosition(oPos)
Dim oSize as new com.sun.star.awt.Size
oSize.Width = 4000 : oSize.Height = 2000
ControlBoton1.setSize(oSize)
ControlBox1.Name="float2"
ControlBox1.label="Stop Process"
ControlBox1.FontHeight = 15
ControlBox1.FontName="Times"
ControlBox1.BackgroundColor=13434879
ControlBox1.MultiLine = True 'False
ControlBoton1.setControl(ControlBox1)
oSheet.DrawPage.add(ControlBoton1)
' Here i need to asign a macro for event "preseed mouse" or others
End sub |
But with a click on the button, I want to execute another macro to stop the process:
1.
How it can assign the macro "StopProcess" to the event "pressed mouse" or when pressing the button of the mouse (in the CommandButton Stop Process").
2.
How it can assign the macro "StopProcess" to the event "Reception foccus" or when reception of the foccus
3.
How it can assign the macro "StopProcess" to the event "Key pressed F4"
thanks for all ! |
|