When you are using Mac OS you can see in many software like iTunes, Adium, AppCleaner, AirRadar a cool looking Mac style Listbox control with white and blue cells. In this quick tutorial we will learn how can we create this kind of effect using REALbasic Listbox control and cell background paint function.
Everything what we need is a Listbox control available on Window1 class and a code in Listbox1 Function CellBackgroundPaint (). After compiling the project we will get a nice looking Listbox control that we can admire in our application.
1 2 3 4 5 6 | if row mod 2 = 0 then g.ForeColor = &cFFFFFF // white color else g.ForeColor = &cf3f7fb // blue color end if g.FillRect 0,0, g.Width, g.Height |
Really nice information you shared with us. Keep it up!
sorry but not working for me… i get a syntax error!!
Try now, there was a bug in color designation. I used mark # instead of &
How can you chnge the color of the heading font &size, and also the background heading color?
What do you mean by the heading font and size, and also the background heading color?