`
Par2: Greenbar a browse 1999-12-21 -- Russ Eggen Go the list box extensions, select the Class tab. Check the derived box. Press the enabled "New class methods" button. Click insert and type the name of your method. Can be any name, and since you are doing a greenbar effect, lets call it "GreenBar". The prototype is (). Click on the Code embed and use code similar to the following (this colors only one column, but I left the BEGIN/END pair in so you can use it for more columns. Also, this assumes a customer list): LOOP X# = 1 TO Records(SELF.Q) !Loop through entire queue GET(SELF.Q,X#) !Read an entry Assert(~ ErrorCode()) !Should be no errors EXECUTE (X# % 2) + 1 !Execute based on modulus math (1 or 2) BEGIN !If odd numbered line, change the colors SELF.Q.CUS:CompanyName_NormalBG = COLOR:Silver !other columns here END BEGIN !If even line, don't change the colors SELF.Q.CUS:CompanyName_NormalBG = COLOR:None !other columns here END END PUT(SELF.Q) !Write back to queue Assert(~ ErrorCode()) !Should not be any errors, so check for one END Jason Austin adds: Hey Russell, that seems a lot of work for a lazy programmer - why not let the existing templates do the work for you without embeds ? Printed November 21, 2024, 1:02 pm This article has been viewed/printed 35205 times. |