Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Software Development
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop driver drivers dvd email error excel excel 2003 firefox hard drive hardware hdmi hijackthis internet itunes keyboard laptop malware monitor motherboard network networking outlook problem recovery router screen slow sound spyware trojan upgrade video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Solved: messagebox to display what was clicked?

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
sdeyoung1974's Avatar
Senior Member with 156 posts.
 
Join Date: Apr 2005
Experience: A+, Network+
01-Nov-2009, 08: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 9,329 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
02-Nov-2009, 06:43 AM #2
What Software are you using?
sdeyoung1974's Avatar
Senior Member with 156 posts.
 
Join Date: Apr 2005
Experience: A+, Network+
02-Nov-2009, 08: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 9,329 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
02-Nov-2009, 12:52 PM #4
Sorry, I only know MS Office VBA.
sdeyoung1974's Avatar
Senior Member with 156 posts.
 
Join Date: Apr 2005
Experience: A+, Network+
03-Nov-2009, 10:28 AM #5
got it figured out.. Thanks anyways..
Reply Bookmark and Share

Smart Search

Find your solution!



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


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 07:47 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.