I'm trying to enable my disabled menu options (cut, copy & paste). The
requirement is to determine what on my form has been selected with the mouse.

How can I determine this?

Re: Form - mouse selected by Kevin

Kevin
Fri Sep 15 11:42:20 CDT 2006

It all depends on what you mean by "selected with the mouse." That is not a
technical term that translates to anything meaningful. Do you mean when a
Control has the focus? If not, what *do* you mean?

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

"mgonzales3" <mgonzales3@discussions.microsoft.com> wrote in message
news:22761E65-328C-495D-9468-B07AFF99C5EE@microsoft.com...
> I'm trying to enable my disabled menu options (cut, copy & paste). The
> requirement is to determine what on my form has been selected with the
> mouse.
>
> How can I determine this?



Re: Form - mouse selected by mgonzales3

mgonzales3
Fri Sep 15 11:55:02 CDT 2006

I have a windows form with a AxSHDocVw embedded. So I want to determine the
following:

A) When a user left-clicks on the mouse and select some text
B) Determine the x and y coordinates of what was selected

when A is fulfilled I want to enable my menu option.
and when the menu copy is clicked I want to copy all text within B.

thanks




"Kevin Spencer" wrote:

> It all depends on what you mean by "selected with the mouse." That is not a
> technical term that translates to anything meaningful. Do you mean when a
> Control has the focus? If not, what *do* you mean?
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> Chicken Salad Surgery
>
> What You Seek Is What You Get.
>
> "mgonzales3" <mgonzales3@discussions.microsoft.com> wrote in message
> news:22761E65-328C-495D-9468-B07AFF99C5EE@microsoft.com...
> > I'm trying to enable my disabled menu options (cut, copy & paste). The
> > requirement is to determine what on my form has been selected with the
> > mouse.
> >
> > How can I determine this?
>
>
>

Re: Form - mouse selected by Dave

Dave
Sat Sep 16 06:20:01 CDT 2006

Hi,

That fact that you're using an ActiveX web browser is really important and should have been mentioned in the OP. You'll have to use
DOM events.

Accessing DHTML DOM through AxSHDocVw (MSDN:)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vsgrfwalkthroughaccessingdhtmldomfromc.asp

document.onselectionchange event (MSDN):
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events/onselectionchange.asp

To copy the selected text you don't need x and y coordinates. See the following links:

execCommand method (MSDN):
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/execcommand.asp?frame=true

Copy command (MSDN):
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/constants/copy.asp

queryCommandEnabled method (MSDN):
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/querycommandenabled.asp?frame=true

HTH

--
Dave Sexton

"mgonzales3" <mgonzales3@discussions.microsoft.com> wrote in message news:06FD13E8-110D-4A7C-B655-947D3043FC1E@microsoft.com...
>I have a windows form with a AxSHDocVw embedded. So I want to determine the
> following:
>
> A) When a user left-clicks on the mouse and select some text
> B) Determine the x and y coordinates of what was selected
>
> when A is fulfilled I want to enable my menu option.
> and when the menu copy is clicked I want to copy all text within B.
>
> thanks
>
>
>
>
> "Kevin Spencer" wrote:
>
>> It all depends on what you mean by "selected with the mouse." That is not a
>> technical term that translates to anything meaningful. Do you mean when a
>> Control has the focus? If not, what *do* you mean?
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> Chicken Salad Surgery
>>
>> What You Seek Is What You Get.
>>
>> "mgonzales3" <mgonzales3@discussions.microsoft.com> wrote in message
>> news:22761E65-328C-495D-9468-B07AFF99C5EE@microsoft.com...
>> > I'm trying to enable my disabled menu options (cut, copy & paste). The
>> > requirement is to determine what on my form has been selected with the
>> > mouse.
>> >
>> > How can I determine this?
>>
>>
>>



Re: Form - mouse selected by Kevin

Kevin
Sat Sep 16 10:06:04 CDT 2006

See http://support.microsoft.com/kb/311284/

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

"mgonzales3" <mgonzales3@discussions.microsoft.com> wrote in message
news:06FD13E8-110D-4A7C-B655-947D3043FC1E@microsoft.com...
>I have a windows form with a AxSHDocVw embedded. So I want to determine
>the
> following:
>
> A) When a user left-clicks on the mouse and select some text
> B) Determine the x and y coordinates of what was selected
>
> when A is fulfilled I want to enable my menu option.
> and when the menu copy is clicked I want to copy all text within B.
>
> thanks
>
>
>
>
> "Kevin Spencer" wrote:
>
>> It all depends on what you mean by "selected with the mouse." That is not
>> a
>> technical term that translates to anything meaningful. Do you mean when a
>> Control has the focus? If not, what *do* you mean?
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> Chicken Salad Surgery
>>
>> What You Seek Is What You Get.
>>
>> "mgonzales3" <mgonzales3@discussions.microsoft.com> wrote in message
>> news:22761E65-328C-495D-9468-B07AFF99C5EE@microsoft.com...
>> > I'm trying to enable my disabled menu options (cut, copy & paste). The
>> > requirement is to determine what on my form has been selected with the
>> > mouse.
>> >
>> > How can I determine this?
>>
>>
>>