How do I style a dialog?

Last night I saw someone ask a similar question but I can’t find it now so I’ll ask. I have a WebDialog that I created and styled. I call it CreateNewMemo. When I drag it onto a page, it’s added as CreateNewMemo1 which is fine. But when I run the project, almost all of the styles are completely lost. It looks like it might keep the label styles but the dialog background is solid white instead of the color I’d chosen in the style for it.

Even when I set the Style property to the CreateNewMemo1 to the right background style, the dialog is still white. Am I doing something wrong or is this the IDE messing something up?


After you’ve dragged the dialog onto your page you’ll need to apply the style to that instance in the inspector.

That is exactly what I’m doing and it’s having no effect at all. The dialog is simply bright white.

Another approach is to put a Rectangle in the dialog and apply the style to that.

This is a known bug <>

This is a workaround if you do not feel to use a Rectangle or a WebContainer to do color background. Note that Xojo does not recommend addressing directly such elements in the Dom that way. It may break if the Xojo Web framework is modified, but given the circumstances…

In the dialog Shown event :

1 Like

That’s what I’m going to do. It’s quick and easy and solves my problem. Thanks Bob!

Is it sill not fixed?

Not according to <>

But in the meantime you can use the workaround.

Ok Thanks.