There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus batch bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop lcd malware memory monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Solved: messagebox to display what was clicked?

Reply  
Thread Tools
sdeyoung1974's Avatar
Member with 162 posts.
 
Join Date: Apr 2005
Experience: A+, Network+
01-Nov-2009, 09:25 PM #1
Solved: messagebox to display what was clicked?
Say I wanted a messagebox to come up when a textbox or radiobutton was clicked. I want the messagebox to display the name of what was clicked(ie: textbox was clicked)

this is what I have so far but it's not displaying the textbox name, it displays "system.windows.forms.textBox" which is not what I'm looking for.

Private Sub txtBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles txtBox.Click


Dim txtTemp As TextBox = DirectCast(sender, TextBox)
'Dim rdoTemp As RadioButton = DirectCast(sender, RadioButton)
'Dim btnTemp As Button = DirectCast(sender, Button)


MessageBox.Show(sender.GetType().ToString)

I know I'm probably just missing something really simple but I can't seem to figure it out. Any help would be appreciated.
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
02-Nov-2009, 07:43 AM #2
What Software are you using?
sdeyoung1974's Avatar
Member with 162 posts.
 
Join Date: Apr 2005
Experience: A+, Network+
02-Nov-2009, 09:10 AM #3
Using Visual Studio 2008. Guess I should of mentioned that I was using VB as a language also : )
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
02-Nov-2009, 01:52 PM #4
Sorry, I only know MS Office VBA.
sdeyoung1974's Avatar
Member with 162 posts.
 
Join Date: Apr 2005
Experience: A+, Network+
03-Nov-2009, 11:28 AM #5
got it figured out.. Thanks anyways..
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:12 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.