Slider control paints with wrong background color

Hi all,

I’m trying to use a Slider inside a GroupBox inside a TabPanel. The TabPanel draws its background as white, but the Slider’s background is grey. I’ve tried putting a white rectangle behind the slider and it still shows up as grey (maybe the Slider is opaque?). Any ideas? This only occurs on Windows, on Mac the slider’s background looks fine (but the TabPanel also renders as grey on Mac too).

Slider under Windows is not transparent (unlike Mac). It is the color of the window. So if you make the window with custom color white, your problem will go away.

Thanks, but this did not seem to work. Plus after changing the window to custom color white, I now have an additional grey artifact next to the tabs of the TabPanel.

I am sorry, but in 2016R1.1 here, when I set the back of the window to blue, the slider becomes blue. Sames thing when I set the window to white.

The issue with the tab control is real, though, as it is opaque and grey.

I would set the window to white, but use Paint to give it the usual grey. So the issue with the tab control won’t present, and the slider will be white.

What version are you using?
I have seen this issue in RealStudio.

I’m also on 2016 R1.1. Not sure why it’s working for you and not for me. The only thing I can think of is perhaps the Frame Type is a “Floating Window”?

I think the problem (in my case at least) boils down to the tabpanel painting as white when all other controls are standard grey. All these other issues would certainly still exist, but would be hidden.

Strangely, everything paints properly in the IDE. Only when running is there a problem.

Just tried changing it to a standard Document window on a different computer (running Win10) and still the issue remains with the slider background color.

There are all kinds of transparency issues with controls in the Windows version, that mostly show when you have layered controls. I have no idea why, but I have found that the rectangle control helps in this regard. Try putting a rectangle control between the slider and the GroupBox, set the border to 0 and make the fill color white (or whatever color you need). Sucks, but these are largely Win32 issues. Enough fiddling and you can usually get what you need.

Thanks Merv, I do indeed have white rectangles under my sliders as was suggested in an old thread from the forums. They are not rendered for some reason.

I just tried it here and seems OK under Windows 7. Are you on 2016r1.1?

I am trying to put together an example project to upload to this thread but have run into a new issue wherein Xojo won’t save. I will create a new thread for that, but may have to jump to my Mac so I can create that project to upload here.

I’m getting exceedingly frustrated with Xojo on Windows. Every workaround breaks something else, and very very basic core functionality doesn’t work as it should. I’m certain there are perfectly valid reasons for things behaving the way they do (the term double-buffering has been thrown around a lot), and everyone in the community and inside Xojo has been wonderful in trying to help, but I find that I end up spending 50% of my time trying to fix stupid cosmetic issues that are nonexistent in other languages. I hope that the Windows framework gets some serious attention soon, because I really do love the Xojo language. I don’t care if it’s using native controls or not, I just want it to work.

For the most part it works fine. The overriding problem is Xojo on Windows builds Win32 apps which are not double-buffered like OS X or .Net programs are. You run into a lot of flickering and transparency issues with Win32. Over time, I was able to convert our older VB6 programs over to Xojo (and had to employ some workarounds here and there) and they run fine on Windows and the Mac, with only a couple of minor issues that I have to live with. It can be frustrating, no doubt.

Have no idea why it won’t save a project file, I’ve never run into that before, maybe you are trying to save in a location you don’t have write permissions?

OK. I found what the problem is : the slider takes the color of the parent. So you want to make sure it is actually child of the control it rests on by verifying you see the red outline when you drag it over.

Here is a demo project :

Jumped over to my Mac and was able to isolate that Window into a new project.

Any ideas why it’s not working?

Michel is right. If you make the sliders children of the rectangles, it displays correctly.

Yay! It works! Thanks guys, especially Michel!

“Children of the Rectangles” is going to be my new band name.