Klogg Posted October 7, 2003 Posted October 7, 2003 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. Quote Take a look at my programs. Go to my web site.
*Experts* mutant Posted October 7, 2003 *Experts* Posted October 7, 2003 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 Quote
Klogg Posted October 7, 2003 Author Posted October 7, 2003 (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 October 7, 2003 by Klogg Quote Take a look at my programs. Go to my web site.
Klogg Posted October 7, 2003 Author Posted October 7, 2003 Never mind. I figured it out. I just have to concatenate Me.ActiveControl.Text to the textbox. Thanks for your help. Quote Take a look at my programs. Go to my web site.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.