Solved

Global detection of active control when text is pasted to a control

Posted on 2002-03-18
5
118 Views
Last Modified: 2010-05-02
There are a set of controls including Text Boxes in a Form.

I am pasting a text onto a Text Box using Mouse/Ctrl+V. Is there any way can the Form Identify in which Control/Text Box the value has been pasted. Can I access the value which has been pasted ?
Is there any API Event or Function through which it can be detected.
0
Comment
Question by:alramanathan
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 10 total points
ID: 6876778
Easy if you use the Text1_Change event or similar for each control that you could paste into.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6876979
If you set the form's KeyPreview property to True, you could use something like this, as an example of the code to implement:


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If (Shift And vbCtrlMask) Then
        If KeyCode = Asc("V") Or KeyCode = Asc("v") Then
            MsgBox "Text pasted into " & Me.ActiveControl.Name & _
                vbCrLf & vbCrLf & "Text pasted: " & Chr(34) & _
                Clipboard.GetText & Chr(34)
        End If
    End If
End Sub
0
 
LVL 15

Expert Comment

by:ameba
ID: 6877635
alramanathan, please, give FEEDBACK in your other question

http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20276373



0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7634133
Hi alramanathan,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

alramanathan, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7665958
Moving to the paq

kb
Experts Exchange Moderator
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now