I´m using this code:

VB Code:
  1. Public Sub submnuCopy_Click()
  2.     Clipboard.Clear
  3.     If TypeOf Screen.ActiveControl Is TextBox Then
  4.         Clipboard.SetText Screen.ActiveControl.SelText
  5.     ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
  6.         Clipboard.SetText Screen.ActiveControl.Text
  7.     ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
  8.         Clipboard.SetData Screen.ActiveControl.Picture
  9.     ElseIf TypeOf Screen.ActiveControl Is ListBox Then
  10.         Clipboard.SetText Screen.ActiveControl.Text
  11.     Else
  12.       ' No action makes sense for the other controls.
  13.     End If
  14.  
  15. End Sub

How do I do to make it work through a Toolbar. The problem is that if I click on the Copy button, I'm getting that the Screen.ActiveControl is set to nothing. How do I change this?