Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > Me.activecontrols not working
 

Me.activecontrols not working

Hi,
I have a toolstripcontainer defined and i have 2 buttons inside the toolstrip. I want to use the Me.Activecontrols.Name to check the button that was clicked, but it always returns the toolstrip control name. Let me know how to get the button that was clicked with Me.ActiveControls.Name

Private

Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click

MsgBox(

Me.ActiveControl.Name)

End Sub

Thanks,
Kris

Kris2006  Wednesday, May 17, 2006 8:22 AM
Which button was clicked is passed in the 'sender' object. You can directcast that to a toolstrip button to work with it, or check the .Name property (i.e. If sender.Name = 'whatever' ...) and go from there.
Richard_Wolf  Wednesday, May 17, 2006 3:12 PM
Which button was clicked is passed in the 'sender' object. You can directcast that to a toolstrip button to work with it, or check the .Name property (i.e. If sender.Name = 'whatever' ...) and go from there.
Richard_Wolf  Wednesday, May 17, 2006 3:12 PM

You can use google to search for other answers

Custom Search

More Threads

• Active Directoty
• Rename a Table in MS Access using VB or SQL statement
• VB.NET RegistryKey.CurrentUser creating separate subkeys in HKEY_CURRENT_USER and HKEY_USER//.DEFAULT
• Radio Buttons within frames
• Urgent Plz : control printer Queue
• datatable time intervals
• how to create a virtual printer
• Console Window Help - Calling an executable in console window process that I start
• Cannot Get this to call Proper object
• Key pressed function