#MhButton
3 messages in this thread
Hi Mark,
I finally received Muscle and was thrilled to see how many routines were
available. It looks like another dynamite product.
I am trying to use an array of MhButtons to implement a tool palette. Only
one tool is to be selected at any one time. I tried to do the following:
Sub Tool_Click(Index As Integer)
For i=0 to MAX_TOOLS
Tool(i).Value = 0
Next i
Tool(Index).Value = -1 End Sub This caused Stack Overflow because
Tool_Click is recursively called every time .Value is changed. Can you
please suggest a solution. Thanks.
Victor
There is 1 Reply.
Victor,
Thanks for the kind words about Muscle!
Re your recursion problem — luckily the answer is very simple:
Sub Tool_Click(Index As Integer)
Static Active% ' Activity flag
If Active% Then
Exit Sub
End If
Active = True
' Do your chores here
Active = False
End Sub
Mark
P.S. VBTools 2.0 will have a toolbox/toolbar control that does exactly what you
are trying to accomplish. Those who are in our early release program have
access to this new tool now.
There is 1 Reply.
Thanks for the solution Mark. I will also take a look a the new control.
Thanks again.