Re: DH
- Posted by "Cuny, David" <David.Cuny at DSS.CA.GOV> Dec 04, 1998
- 438 views
Lewis Townsend wrote: > ...when I push the "add" button, I want the focus > to go back to the "EDIT" box Use setFocus() in the onClick() behavior of the button. > ... is there a way to change colors of controls or > at least draw colored shapes (rectangles specifically)? Urgh. To my suprise, setWindowBackColor doesn't work. You can use drawRectangle() to draw a rectangle, but filled shapes are the bleeding edge of Win32Lib. You need to set call CreateSolidBrush() to create a brush of the appropriate color, and then SelectObject to assign it. Actually, Win32Lib uses ReplaceObject to keep track of resources instead of SelectObject, so they are automatically disposed of... Bottom line: there is currently no easy way to do this. > How do I get the list into a sequence without complicated > errorchecking and "for" loops? Is there a way to find out > how many ITEMS are in the list? Well, since your application is what populated the list in the first place, you just need to keep track of what you put into the list. The function getCount() returns the count of items in the list. The function getItem() retrieves an item. I'm not sure what sort of complicated error checking you're talking about, but you do need to use a "for" loop to retrieve the data. No big deal: function getItems( integer control ) -- copy items from list into sequence sequence items items = {} for i = 1 to getCount( control ) items = append( items, getItem( control, i ) ) end for return items end function Hope this helps! -- David Cuny