Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I've got another question. In my calculator program, I want to combine the click event subprocedures of the 0-9, negative, and point buttons so that my code will be shorter and easier to read. I was thinking of doing this by assigning to the text box the Text property of the button that has the focus. The problem is that I don't know how (or if it's possible) to tell the program to use a property of the button that has the focus or was just clicked. If you could tell me how to do this or a different way to do it, I would appreciate it.
Take a look at my programs. Go to my web site.
  • *Experts*
Posted

You can use the ActiveControl property of the form to get the active control. Then you can check what type of control it is:

If TypeOf Me.ActiveControl Is Button THen
'do something
End If

Posted (edited)
Does the condition return true if the active control is a button? If so, how do I tell it to determine which of the buttons is being clicked? Edited by Klogg
Take a look at my programs. Go to my web site.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...