Modify CSS Stylesheet?

Is it possible to modify a css style sheet included in my project?

You can define a style and assign it to an item.
Now in a WebPageSource control you can include the html code to declare additional properties to this style.

However, I’m trying to do this with a desktop app with a HTMLViewer, is this possible with a desktop app?

you can always execute javascript code to modify CSS on the fly.


Hello Christian,

Can you please give some more detail on defining a style and assigning it to an item?

Also how to modify css on the fly - are there any example projects out there that show this?

I am trying to work out how to use CSS with xojo, so I can achieve consistent styling, and be able to change styles of many controls in one place (a la CSS). I would appreciate any advice you can give me!


Maybe this helps you?


That helps a bit - I can see in their example project how they have associated the style with the button - but I can’t see any CSS in Xojo. I’m guessing they created a Web Style, called PrintHiddenStyle, but it doesn’t seem to have anything in it. How did they add the CSS, and where is it?

The instructions say to “add a page source object to your web page” and paste the CSS in there, but I don’t know how to do that!

The CSS is on the page source object on the webpage. And in inspector you find the CSS.

OK, thanks.

Is it obvious and I’m just not seeing it … how do I add a page source object to the web page?

Sorry, I really am googling before I ask, but ‘add a “page source object” web page’ just yields 9 results and nothing useful - thanks for your help!

Don’t you see the controls on the webpage?
There is one named PageSource1.

is it possible to have a css as a external file and read in the css and put it in page source object when opening the application?

yes, of course. Or put the CSS in extra file on server and reference it.

so how do i assign css codes in the external file on server to the page source object?

does that also mean anything can be loaded from the extra… not just css??

If you have images or videos in your web app, it may be more efficient to host them with normal apache and just reference them by URL instead of WebPicture/Webfile.

sound cool… so having the URL in the page source object. I assume it will be faster for loading too.

[quote=53017:@Christian Schmitz]Don’t you see the controls on the webpage?
There is one named PageSource1.[/quote]

Yes I see it, but how do I add a page source object to my own project?

Page Source is a control in the library and you can drag & drop it on your webpage.

Right, got it!

Is there anywhere I can learn these fundamentals without asking one question at a time? :slight_smile: