I have an array of checkboxes, I want the clicked one to look checked
(like a radio button group, but I want checkboxes):
Sub Action(index as Integer)
dim j as integer
' clear all but the index checkbox
for j = 0 to 3
if (j = index) then
self.CheckBox1(j).value = true
else
self.CheckBox1(j).value = false
end if
next
Return
End Sub
You'd think this would be a no-brainer but it doesn't work because the
self.CheckBox1(j).value = true/false stmnts fire new Action events in
the other (jth) checkboxes so everything gets screwed up.
I think firing events in response to control changes in done in code
is a dumb idea. Action is a user action, not a program's execution.
If I'm explicitly doing self.CheckBox1(j).value = true I don't need to
be told that I've just done this by having a new event fired!
Ditto for TextChanged events in editfields, etc...
There should be an easy way to tell whether an "event" was triggered
by the user vs. code.
Don't others agree?
P.
--
-------------------------------------------------------------------------------
Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience
Ottawa Hospital / University of Ottawa
Ontario, CANADA
tel: (613)761-5444
fax: (613)761-5330
http://www.ohri.ca/profiles/stys.asp
-------------------------------------------------------------------------------
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>