By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

how to enable/disable paste

P: n/a
Here's my newbie question:

I have several VB forms which are all inherit a standard template form
that I made. In my template form, I added a menu bar with some
generic cut, copy, and paste functionality.

I'd like to have the paste button disabled when the clipboard is
empty, but I'm not sure how I should do this. Ideally, I suppose I'd
like to constantly monitor the clipboard for data, (in a thread?) but
I'm not even sure how I'd monitor the clipboard.

while (1==1)
if clipboard != mt
enable paste
else
disable paste

Or maybe there there's an event that I could monitor?

on Event
if clipboard != mt
enable paste
else
disable paste

What's the best way to tackle this?

TIA
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
well i think there must be an event somewhere but I don't know where...

the while(1=1) is a bad idea, will use too much cpu...
something you can also use is listen on the popup event of the menuitem to
dis/enable your menuitem...

hope this helps

dominique
"Stilgar[bbs.isca.uiowa.edu]" <no****@yakhair.com> wrote in message
news:4d*************************@posting.google.co m...
Here's my newbie question:

I have several VB forms which are all inherit a standard template form
that I made. In my template form, I added a menu bar with some
generic cut, copy, and paste functionality.

I'd like to have the paste button disabled when the clipboard is
empty, but I'm not sure how I should do this. Ideally, I suppose I'd
like to constantly monitor the clipboard for data, (in a thread?) but
I'm not even sure how I'd monitor the clipboard.

while (1==1)
if clipboard != mt
enable paste
else
disable paste

Or maybe there there's an event that I could monitor?

on Event
if clipboard != mt
enable paste
else
disable paste

What's the best way to tackle this?

TIA

Nov 20 '05 #2

P: n/a
I can't listen for the pop-up event because I'm also using the
standard cut, copy, paste shortcut keys (ctrl-x, ctrl-c, ctrl-v),
unless using the shortcut keys activates the menu event too??? I
guess I'll have to try that.

You're right about using "while(1==1)" using a lot of CPU, that's why
I'd make my application multithreaded and use VB's equivalent of
wait() or sleep().

"Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in message news:<uY**************@tk2msftngp13.phx.gbl>...
well i think there must be an event somewhere but I don't know where...

the while(1=1) is a bad idea, will use too much cpu...
something you can also use is listen on the popup event of the menuitem to
dis/enable your menuitem...

hope this helps

dominique
"Stilgar[bbs.isca.uiowa.edu]" <no****@yakhair.com> wrote in message
news:4d*************************@posting.google.co m...
Here's my newbie question:

I have several VB forms which are all inherit a standard template form
that I made. In my template form, I added a menu bar with some
generic cut, copy, and paste functionality.

I'd like to have the paste button disabled when the clipboard is
empty, but I'm not sure how I should do this. Ideally, I suppose I'd
like to constantly monitor the clipboard for data, (in a thread?) but
I'm not even sure how I'd monitor the clipboard.

while (1==1)
if clipboard != mt
enable paste
else
disable paste

Or maybe there there's an event that I could monitor?

on Event
if clipboard != mt
enable paste
else
disable paste

What's the best way to tackle this?

TIA

Nov 20 '05 #3

P: n/a
I don't see the problem with the shortcut keys. I suppose you listen for the
keyevent for that.
When you receive the keyevent just check the clipboard like you do in the
popup event.
If the clipboard is empty (for ctrl-v) just return...

Dominique
"Stilgar[bbs.isca.uiowa.edu]" <no****@yakhair.com> wrote in message
news:4d************************@posting.google.com ...
I can't listen for the pop-up event because I'm also using the
standard cut, copy, paste shortcut keys (ctrl-x, ctrl-c, ctrl-v),
unless using the shortcut keys activates the menu event too??? I
guess I'll have to try that.

You're right about using "while(1==1)" using a lot of CPU, that's why
I'd make my application multithreaded and use VB's equivalent of
wait() or sleep().

"Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in

message news:<uY**************@tk2msftngp13.phx.gbl>...
well i think there must be an event somewhere but I don't know where...

the while(1=1) is a bad idea, will use too much cpu...
something you can also use is listen on the popup event of the menuitem to dis/enable your menuitem...

hope this helps

dominique
"Stilgar[bbs.isca.uiowa.edu]" <no****@yakhair.com> wrote in message
news:4d*************************@posting.google.co m...
Here's my newbie question:

I have several VB forms which are all inherit a standard template form
that I made. In my template form, I added a menu bar with some
generic cut, copy, and paste functionality.

I'd like to have the paste button disabled when the clipboard is
empty, but I'm not sure how I should do this. Ideally, I suppose I'd
like to constantly monitor the clipboard for data, (in a thread?) but
I'm not even sure how I'd monitor the clipboard.

while (1==1)
if clipboard != mt
enable paste
else
disable paste

Or maybe there there's an event that I could monitor?

on Event
if clipboard != mt
enable paste
else
disable paste

What's the best way to tackle this?

TIA

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.