Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

First, I'd like to thank all these people for their time and patience in helping us newbies.

 

I have a form with many textboxes. I'd like to know which form has focus so that Cut, Copy, Paste can work on it. And I can't understand how to find which textbox has focus.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • *Experts*
Posted

Ok...I got the paste command;

If Clipboard.GetDataObject.GetDataPresent(DataFormats.Text) Then

Me.ActiveControl.Text = Me.ActiveControl.Text & Clipboard.GetDataObject.GetData(DataFormats.Text)

End If

 

But I'm having a bit of a problem with the copy and cut commands...Please Help!

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • *Experts*
Posted

divil...it works great! I thought only RTF boxes were capabile of proper clipboard commands...guess not.

 

Thanks for your help!

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • *Experts*
Posted

Cut:

DirectCast(Me.ActiveControl, TextBox).Cut()

 

Copy:

DirectCast(Me.ActiveControl, TextBox).Copy()

 

Paste:

If Clipboard.GetDataObject.GetDataPresent(DataFormats.Text) Then

DirectCast(Me.ActiveControl, TextBox).Paste()

 

It doesn't get any simplier...Thanks again divil!!!

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...