*Experts* DiverDan Posted January 29, 2003 *Experts* Posted January 29, 2003 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. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
*Experts* Volte Posted January 29, 2003 *Experts* Posted January 29, 2003 Use Me.ActiveControl to return the currently active control on a form. Quote
*Experts* DiverDan Posted January 29, 2003 Author *Experts* Posted January 29, 2003 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! Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
*Gurus* divil Posted January 29, 2003 *Gurus* Posted January 29, 2003 I think Textboxes have proper clipboard commands: DirectCast(Me.ActiveControl, TextBox).Cut() Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* DiverDan Posted January 29, 2003 Author *Experts* Posted January 29, 2003 divil...it works great! I thought only RTF boxes were capabile of proper clipboard commands...guess not. Thanks for your help! Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
*Experts* DiverDan Posted January 29, 2003 Author *Experts* Posted January 29, 2003 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!!! Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.