PC Review


Reply
Thread Tools Rate Thread

Detecting selection before click

 
 
MrT
Guest
Posts: n/a
 
      4th Nov 2009
Hello,
On a sheet, I have two shapes (say two Ovals) and an ActiveX button. Let's
select one of the two shapes. I want to know when I click on the button, what
shape was selected before the button got activated. I could not find an
answer after searching for a while as there no event such as beforeclick.
Thanks in advance for any help,
MrT
 
Reply With Quote
 
 
 
 
MrT
Guest
Posts: n/a
 
      4th Nov 2009
Well, I've just found the answer: you need to set the TakeTheFocus property
to false ...

"MrT" wrote:

> Hello,
> On a sheet, I have two shapes (say two Ovals) and an ActiveX button. Let's
> select one of the two shapes. I want to know when I click on the button, what
> shape was selected before the button got activated. I could not find an
> answer after searching for a while as there no event such as beforeclick.
> Thanks in advance for any help,
> MrT

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      4th Nov 2009
If you use a Forms button rather than a Controls button:

Sub WhoGotClicked()
MsgBox (Selection.Name)
End Sub

will tell you which Shape got clicked.
--
Gary''s Student - gsnu200908


"MrT" wrote:

> Well, I've just found the answer: you need to set the TakeTheFocus property
> to false ...
>
> "MrT" wrote:
>
> > Hello,
> > On a sheet, I have two shapes (say two Ovals) and an ActiveX button. Let's
> > select one of the two shapes. I want to know when I click on the button, what
> > shape was selected before the button got activated. I could not find an
> > answer after searching for a while as there no event such as beforeclick.
> > Thanks in advance for any help,
> > MrT

 
Reply With Quote
 
MrT
Guest
Posts: n/a
 
      4th Nov 2009
The problem of form buttons is that you cannot control many things such as
background color.

"Gary''s Student" wrote:

> If you use a Forms button rather than a Controls button:
>
> Sub WhoGotClicked()
> MsgBox (Selection.Name)
> End Sub
>
> will tell you which Shape got clicked.
> --
> Gary''s Student - gsnu200908
>
>
> "MrT" wrote:
>
> > Well, I've just found the answer: you need to set the TakeTheFocus property
> > to false ...
> >
> > "MrT" wrote:
> >
> > > Hello,
> > > On a sheet, I have two shapes (say two Ovals) and an ActiveX button. Let's
> > > select one of the two shapes. I want to know when I click on the button, what
> > > shape was selected before the button got activated. I could not find an
> > > answer after searching for a while as there no event such as beforeclick.
> > > Thanks in advance for any help,
> > > MrT

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      4th Nov 2009
If your interest is in background color, you can assign a macro to any piece
from the Drawing toolbar and assign any color to the shape.

Of course, this ruins your ultimate goal of capturing the shape that got
clicked!
--
Gary''s Student - gsnu200908


"MrT" wrote:

> The problem of form buttons is that you cannot control many things such as
> background color.
>
> "Gary''s Student" wrote:
>
> > If you use a Forms button rather than a Controls button:
> >
> > Sub WhoGotClicked()
> > MsgBox (Selection.Name)
> > End Sub
> >
> > will tell you which Shape got clicked.
> > --
> > Gary''s Student - gsnu200908
> >
> >
> > "MrT" wrote:
> >
> > > Well, I've just found the answer: you need to set the TakeTheFocus property
> > > to false ...
> > >
> > > "MrT" wrote:
> > >
> > > > Hello,
> > > > On a sheet, I have two shapes (say two Ovals) and an ActiveX button. Let's
> > > > select one of the two shapes. I want to know when I click on the button, what
> > > > shape was selected before the button got activated. I could not find an
> > > > answer after searching for a while as there no event such as beforeclick.
> > > > Thanks in advance for any help,
> > > > MrT

 
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
Detecting Record Selection in a Form =?Utf-8?B?U3dpbW1pbnNjaHJhZ2U=?= Microsoft Access Form Coding 2 30th Jul 2007 05:12 PM
Detecting a ComboBox selection =?Utf-8?B?Tm9ybUQ=?= Microsoft Dot NET Framework 7 5th Oct 2005 04:20 PM
Detecting Row Selection Nigel Microsoft Excel Programming 1 2nd Jan 2005 03:48 PM
Help Detecting when the PhoneX selection is changed David Microsoft Outlook Form Programming 3 9th Jun 2004 04:09 PM
Detecting selection of InBox BartH Microsoft Outlook VBA Programming 4 20th Nov 2003 09:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:47 AM.