SetTheme function

Official Content
This documentation is valid for:

The SetTheme function changes the current Theme to the one specified in run-time. It returns 1 if the Theme could be changed. Otherwise, it returns a zero value.

Syntax

SetTheme(ThemeObjectName)

where:
     the ThemeObjectName string is the name (not description) of a Theme in your Knowledge Base.

If the specified Theme is not found, no Theme change is performed and the current Theme remains as if the method were not executed. Once the SetTheme function has been successful the Theme setting remains active for the rest of the session. In Web applications, it means that GeneXus code automatically saves the value of the current Theme in the current session.

Examples

Event &MyTheme.Click
    If SetTheme(&MyTheme)<>0
       ...
    EndIf
EndEvent
Event 'Orange'
    &NumVar = SetTheme(!'Orange')   // Set the web page with the Orange theme inmediately.
EndEvent

Take into account the "!" symbol before the theme name for translation reasons. (For further information see Application Localization).

Scope

Objects   Web Panel object
Languages .NET, Java, Ruby
Platforms Web
   

See also

GetTheme function





Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.