Control ToolBox-Assign Spinbuttons to Textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, Could anybody tell me how to assign the spinbuttons that I have created
to the appropriate textbox. I have created the max/min for them and formatted
them fine. I just don't know how to link the textbox to the spinbutton so
that it changes by 1 when the spinbutton is clicked. Thanks for your help.
 
I'm using a control textbox.

Doubleclick the spin button to get to its Change event code. Make it like so:

Private Sub SpinButton1_Change()
' Change the names of controls as needed:
Me.TextBox1.Text = CStr(Me.SpinButton1.Value)
End Sub

That should about do it, I think. You may want to set a min and max for the spin
button as well.
 
Could you explain to me what the "me." command is all about and what it
represents. I didn't get an error but the value in the textbox still didn't
change. Maybe there is some sort of textbox refresh command that I need to
invoke after each change?
 
Could you explain to me what the "me." command is all about and what it
represents.

Me represents the object that "contains" the control, in this case the slide the
control's on. It saves several tens of lines of code that has to figure out what slide
you're on and get a reference to the control object.
I didn't get an error but the value in the textbox still didn't
change. Maybe there is some sort of textbox refresh command that I need to
invoke after each change?

You shouldn't have to do that, but you would have to supply the correct name for the
control. The example below uses the default names that PPT supplies when you insert the
FIRST of each type of control on a slide.
 
Back
Top