PC Review


Reply
Thread Tools Rate Thread

CAN I ADD CONTROLX BUTTON TO CUSTOMISED TOOLBARS

 
 
=?Utf-8?B?SkFTT04=?=
Guest
Posts: n/a
 
      22nd Apr 2007
I AM TRYING TO CREATE A CUSTOMISED TOOLBARS HOLDING SOME CONTROL X COMMAND
BUTTONS. EG OF HOW THE BUTTON WORKS AS FOLLOWS :

WHEN I CLICK ON THE BUTTON AND HOLD ON TO THE BUTTON, IT WILL CONTINUOUSLY
MOVE THE SELECTED OBJECT SAY A DRAWN RECTANGLE ON A WORKSHEET TO THE LEFT AND
WILL STOP MOVING ONCE I RELEASE THE BUTTON.

I NEED THE BUTTON ON THE TOOLBAR TO BE CONTROL X COS I NEED THE MOUSE CLICK
MOUSE UP EVENTS TO PROGRAM THE ABOVE.

THE REASON WHY I DON USE THE COMMAND BUTTON ON THE WORKSHEET IS BECAUSE WHEN
I SCROLL DOWN THE WINDOW THE COMMAND BUTTON WILL BE OUT OF VIEW. SO I NEED
THE BUTTON TO BE AT THE TOOLBARS SO THAT WHEN I SCROLL TO ANY PORTION OF THE
WORKSHEET, THE COMMAND BUTTION REMAIN IN THE SAME PLACE WHERE I CAN EASILY
ACCESS IT.

OR ANYONE KNOW OF HOW TO STATION A COMMAND BUTTON ON A WORKSHEET AT A
LOCATION SO THAT IT WONT MOVE OUT OF VIEW WHEN I SCROLL THE WINDOW?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R3JlZyBXaWxzb24=?=
Guest
Posts: n/a
 
      23rd Apr 2007
This is already supported by the arrow keys.

FYI, for continued execution of a macro, I would take advantage of the fact
that assigning a macro to a keyboard key allows repeated execution while the
key is held down. A macro is continually executed the same way holding down
the "a" key produces a long string of a's ("aaaaaaaaaaaaaa").

I would create the toolbar programmatically on open (which I always do) and
assign the "TogRemap" macro to the desired button. Assumed is that the macros
"Macro1", "Macro2" etc. are your macros. Code examples:

Sub TogRemap()
With Application.CommandBars.ActionControl
If .State = msoButtonUp Then
.State = msoButtonDown
RemapKeys
Else
.State = msoButtonUp
ResetKeys
End If
End With
End Sub

Sub RemapKeys()
With Application
.Cursor = xlNorthwestArrow
.OnKey "{UP}", "Macro1"
.OnKey "{DOWN}", "Macro2"
.OnKey "{LEFT}", "Macro3"
.OnKey "{RIGHT}", "Macro4"
End With
End Sub

Sub ResetKeys()
With Application
.Cursor = xlDefault
.OnKey "{UP}"
.OnKey "{DOWN}"
.OnKey "{LEFT}"
.OnKey "{RIGHT}"
End With
End Sub

Regards,
Greg
 
Reply With Quote
 
=?Utf-8?B?R3JlZyBXaWxzb24=?=
Guest
Posts: n/a
 
      23rd Apr 2007
Just in case my first post wasn't clear, from what you describe, you probably
don't need any code or toolbar at all. Just use the arrow keys while the
object is selected.
My code examples were only intended for general info.

I've done the same thing you describe with photos except I select them by
simply holding the mouse pointer over the desired photo (don't like the look
of the sizing handles). However, the code that translates mouse coordinates
to excel's points that allows identification of the selected object isn't
that simple.

Greg

"JASON" wrote:

> I AM TRYING TO CREATE A CUSTOMISED TOOLBARS HOLDING SOME CONTROL X COMMAND
> BUTTONS. EG OF HOW THE BUTTON WORKS AS FOLLOWS :
>
> WHEN I CLICK ON THE BUTTON AND HOLD ON TO THE BUTTON, IT WILL CONTINUOUSLY
> MOVE THE SELECTED OBJECT SAY A DRAWN RECTANGLE ON A WORKSHEET TO THE LEFT AND
> WILL STOP MOVING ONCE I RELEASE THE BUTTON.
>
> I NEED THE BUTTON ON THE TOOLBAR TO BE CONTROL X COS I NEED THE MOUSE CLICK
> MOUSE UP EVENTS TO PROGRAM THE ABOVE.
>
> THE REASON WHY I DON USE THE COMMAND BUTTON ON THE WORKSHEET IS BECAUSE WHEN
> I SCROLL DOWN THE WINDOW THE COMMAND BUTTON WILL BE OUT OF VIEW. SO I NEED
> THE BUTTON TO BE AT THE TOOLBARS SO THAT WHEN I SCROLL TO ANY PORTION OF THE
> WORKSHEET, THE COMMAND BUTTION REMAIN IN THE SAME PLACE WHERE I CAN EASILY
> ACCESS IT.
>
> OR ANYONE KNOW OF HOW TO STATION A COMMAND BUTTON ON A WORKSHEET AT A
> LOCATION SO THAT IT WONT MOVE OUT OF VIEW WHEN I SCROLL THE WINDOW?

 
Reply With Quote
 
Wei Lu [MSFT]
Guest
Posts: n/a
 
      25th Apr 2007
Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't save my customised toolbars =?Utf-8?B?T3p0YXVydXM=?= Microsoft Word Document Management 3 16th Mar 2006 03:48 PM
DataRepeater FindControl("controlX") ControlX was added to placeho =?Utf-8?B?V2ViTWF0cml4?= Microsoft ASP .NET 1 14th Feb 2006 08:34 PM
Re: Transferring customised toolbars Suzanne S. Barnhill Microsoft Word Document Management 0 15th Jan 2006 05:25 PM
Re: Transferring customised toolbars Tony Jollans Microsoft Word Document Management 0 15th Jan 2006 03:05 PM
Customised Toolbars Michael Microsoft Excel Discussion 1 7th Sep 2004 01:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:08 PM.