Click here to Skip to main content
15,914,780 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Windows CRC Programming Requested Pin
Dave Kreskowiak6-Apr-04 6:11
mveDave Kreskowiak6-Apr-04 6:11 
GeneralRe: Windows CRC Programming Requested Pin
Member 9170837-Apr-04 3:59
Member 9170837-Apr-04 3:59 
GeneralRe: Windows CRC Programming Requested Pin
Dave Kreskowiak7-Apr-04 5:26
mveDave Kreskowiak7-Apr-04 5:26 
GeneralRemoving program Pin
LeprosyLM6-Apr-04 4:52
LeprosyLM6-Apr-04 4:52 
GeneralRe: Removing program Pin
Dave Kreskowiak6-Apr-04 6:10
mveDave Kreskowiak6-Apr-04 6:10 
GeneralMultilingual in VB6 Pin
adarsh_sebiz6-Apr-04 3:47
adarsh_sebiz6-Apr-04 3:47 
GeneralFinding focus on windows forms Pin
David O6-Apr-04 0:47
David O6-Apr-04 0:47 
GeneralRe: Finding focus on windows forms Pin
Member 10089689-Apr-04 4:55
Member 10089689-Apr-04 4:55 
Hi David

Try this:

Dim a module level string
e.g. Dim CurrentCtrl as string

In the GotFocus event of each control that you need to get the text, put the following code:

CurrentCtrl = Form1.ActiveControl.Text (replace Form1 with actual form/location name)

Then from your menu you can send the value in CurrentCtrl to the clipboard.

Below is some code to give you the idea, if you need it.

On the form is a frame; inside the frame are 5 text boxes. There's a menu with two options: To Clipboard and From Clipboard. Also on the form is a label: just displays what's on the clipboard when From Clipboard is selected from menu.

**********************************
Option Explicit

Dim CurrentCtrl As String
Dim LastCtrl As String

Private Sub Form_Activate()
Text1.SetFocus
End Sub

Private Sub mnuFromClipboard_Click()
Label1.Caption = Clipboard.GetText
End Sub

Private Sub mnuToClipboard_Click()
Clipboard.SetText (CurrentCtrl)
End Sub

Private Sub Text1_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub

Private Sub Text2_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub

Private Sub Text3_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub

Private Sub Text4_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub

Private Sub Text5_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub
*******************************************

Oh, by the way the module variable LastCtrl can be utilised by much the same code as in the GotFocus except it goes in the LostFocus event of each control

Anyhow this should give you a start in the right direction, I hope.

Budgieboy
GeneralRe: Finding focus on windows forms Pin
David O11-Apr-04 23:29
David O11-Apr-04 23:29 
QuestionHow to add popup menu item in Windows Explorer popup menu Pin
Mayank Kumar5-Apr-04 21:31
Mayank Kumar5-Apr-04 21:31 
AnswerRe: How to add popup menu item in Windows Explorer popup menu Pin
Hesham Amin5-Apr-04 22:15
Hesham Amin5-Apr-04 22:15 
GeneralWindows Service for Internet time logging Pin
DHARMA.R5-Apr-04 19:37
DHARMA.R5-Apr-04 19:37 
GeneralRe: Windows Service for Internet time logging Pin
Milton Karimbekallil5-Apr-04 20:43
Milton Karimbekallil5-Apr-04 20:43 
GeneralRe: Windows Service for Internet time logging Pin
Dave Kreskowiak6-Apr-04 0:51
mveDave Kreskowiak6-Apr-04 0:51 
GeneralRe: Windows Service for Internet time logging Pin
DHARMA.R6-Apr-04 4:00
DHARMA.R6-Apr-04 4:00 
GeneralRe: Windows Service for Internet time logging Pin
Dave Kreskowiak6-Apr-04 5:51
mveDave Kreskowiak6-Apr-04 5:51 
GeneralRe: Windows Service for Internet time logging Pin
DHARMA.R6-Apr-04 20:25
DHARMA.R6-Apr-04 20:25 
GeneralRe: Windows Service for Internet time logging Pin
Dave Kreskowiak7-Apr-04 1:19
mveDave Kreskowiak7-Apr-04 1:19 
GeneralRe: Windows Service for Internet time logging Pin
DHARMA.R7-Apr-04 18:00
DHARMA.R7-Apr-04 18:00 
GeneralDataset to Textboxes Pin
trg50305-Apr-04 19:07
trg50305-Apr-04 19:07 
GeneralRe: Dataset to Textboxes Pin
Alberto Venditti5-Apr-04 20:57
Alberto Venditti5-Apr-04 20:57 
GeneralRe: Dataset to Textboxes Pin
trg50306-Apr-04 13:12
trg50306-Apr-04 13:12 
GeneralRe: Dataset to Textboxes Pin
trg50306-Apr-04 18:53
trg50306-Apr-04 18:53 
QuestionHow to get target path of Shorcut (lnk) files in VB 6 Pin
EmanAli5-Apr-04 19:06
EmanAli5-Apr-04 19:06 
AnswerRe: How to get target path of Shorcut (lnk) files in VB 6 Pin
Milton Karimbekallil5-Apr-04 22:54
Milton Karimbekallil5-Apr-04 22:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.