473,386 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to enable/disable paste

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
3 6643
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alphonse Giambrone | last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side and am generating an error. I had found some documentation on validation which states that I should be able to...
3
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76)...
0
by: talal | last post by:
How to check whether javascript is enable or disable in client browser. Remeber i can check wheter browser client support javascript with BrowserCapability class. But what if the client has disable...
2
by: JohnProgrammer | last post by:
I know I can fill the screen in VB.NET by starting my window maximized and without a border. My question is; in VB.NET is there a way to enable/disable the taskbar much like doing the "always on...
4
by: mabond | last post by:
Does anyone know some code that will allow me to enable and/or disable a task which already exists in the task scheduer. I have a task which runs at 15 min intervals and from time to time I want to...
8
by: rongchaua | last post by:
Hi all, i would like now to disable and enable network adapter programmatically with c#. I have searched but found nothing useful. There's no topic about this problem. Has someone done with this...
6
by: =?Utf-8?B?TWljaGFlbCAwMw==?= | last post by:
I need to disable the clipboard function in Windows XP. We are having a problem with users using CTRL+C in one program, then using CTRL+V in another. Specifically, they type their password into...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
2
by: Naushad | last post by:
Hi all, I am using the countinous form. I want to Enable/Disable the some fields for perticular records as per the following condition when open the form. I have written this code in "On Current...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.