| View previous topic :: View next topic |
| Author |
Message |
Oskars Guest
|
Posted: Mon Jun 14, 2004 3:06 am Post subject: How Can I insert a Button in a Document, but not in a form? |
|
|
and track / assign key pressed event to it?
I'v got VB code witch connect to SQL Server and updates fields in the Sheet.
It all works fine in Excel, but in Spreadsheet it doesn't.
Any Ideas?
Oskars. |
|
| Back to top |
|
 |
davidh182 OOo Advocate

Joined: 01 Apr 2004 Posts: 413
|
Posted: Tue Jun 15, 2004 1:23 am Post subject: |
|
|
Look in "Form Functions" on the main toolbar (left of sheet)
From there you can put a button on the sheet and assign macro to it
You can assign a different macro to each action [mouse over, key press etc.]
Then click "Design Mode on/off" [2nd row of "Form Functions"] to activate it. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Tue Jun 15, 2004 6:27 am Post subject: |
|
|
In the end, the button must be part of a form.
The form doesn't have to do anything. There is no drawback to the requirement for a control to be part of a form.
You can have as many forms per page as you wish. Forms don't impose any requirement to be using a database or be tied in any way to a database.
Think of a form as just a way of grouping buttons. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
geoff_f OOo Enthusiast

Joined: 21 Nov 2003 Posts: 181 Location: Canberra, Australia
|
Posted: Wed Jun 16, 2004 3:41 am Post subject: |
|
|
DannyB said: | Quote: | In the end, the button must be part of a form.
The form doesn't have to do anything. There is no drawback to the requirement for a control to be part of a form.
You can have as many forms per page as you wish. Forms don't impose any requirement to be using a database or be tied in any way to a database.
Think of a form as just a way of grouping buttons. |
This might be true of Draw, but not of Calc. You can simply insert buttons anywhere onto the sheet and assign a macro to them, with no forms involved, just as davidh182 said. I used this method when I created my Clueless Crossword Solver, which you can see here:
http://www.ooomacros.org/user.php |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Sun Jun 27, 2004 10:25 am Post subject: |
|
|
| geoff_f wrote: | | DannyB wrote: | | In the end, the button must be part of a form. |
This might be true of Draw, but not of Calc. You can simply insert buttons anywhere onto the sheet and assign a macro to them, with no forms involved, just as davidh182 said. |
Can you provide an example of how this is true?
I just created a Calc spreadsheeet.
Draw a simple button onto it.
Then bring up the Form Navigator. (Fifth button from the right, buttom row, of Form Functions tear off window.)
The button I just put onto the spreadsheet is definitely within a form called "Standard".
I do not see how it would be possible to have a control that is NOT part of a form?
I just answerd a question about how to add a button to a spreadsheet.
http://www.oooforum.org/forum/viewtopic.php?t=10230
I know of no simpler procedure to add a button to a spreadsheet. Even the simple procedure I described results in the button being in the "Standard" form, even though you did not expressly create a form. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
geoff_f OOo Enthusiast

Joined: 21 Nov 2003 Posts: 181 Location: Canberra, Australia
|
Posted: Mon Jun 28, 2004 3:12 am Post subject: |
|
|
DannyB said: | Quote: | | Can you provide an example of how this is true? |
The example I gave was in my next sentence:
I've just checked that file using the form navigator as described by DannyB, and have found that the buttons are indeed in a form; mine are in a form called 'WW-Standard' . So it seems that Calc will put any buttons you create in a form by default, despite your not having created a form explicitly. But it is still true that you can put buttons in a form without first creating a form for them, as the Help files suggest you need to do (Help-> Forms; editing and creating-> New Form).
In hindsight, my use of 'with no forms involved' was loose wording. What I should have said is 'You can simply insert buttons anywhere onto the sheet and assign a macro to them, without first explicitly creating a form'. But DannyB is right, the buttons must be part of a form; Calc will see to that, even if you don't. |
|
| Back to top |
|
 |
|