Ver Mensaje Individual
  #1  
Antiguo 15-05-2016
Avatar de turbopascual5.0
turbopascual5.0 turbopascual5.0 is offline
Miembro
 
Registrado: feb 2011
Posts: 54
Reputación: 14
turbopascual5.0 Va por buen camino
Error en asignación de default style

Hola a todos.
He implementado que en el aplicativo se pueda cambiar el estilo.
Hay varios ejemplos por la web y en la doc de Embarcadero.
En concreto el error se produce en este procedimiento:
Código Delphi [-]
procedure TTabbedwithNavigationForm.ComboBox1Change(Sender: TObject); 
var  aTos: string;  
aStyle: TfmxObject;  
begin 
  aStyle:=nil; 
  if combobox1.itemindex > 0  then 
  begin    
    atos:=combobox1.selected.text;    
    aStyle:=TStyleStreaming.LoadFromResource(HInstance, aTos, RT_RCDATA);    
    if NOT assigned(astyle) then        
    begin          
      showmessage(atos+linefeed+'Not Found');        
    end;  
  end;   
  if astyle <> nil then       
    TStyleManager.SetStyle(astyle)   
  else     
    TStyleManager.SetStyle(nil);  // set the "default" style 
end;
La parte del if then else es redundante, pero quería determinar exactamente donde seproducía el error:
Código Delphi [-]
TStyleManager.SetStyle(nil);  // set the "default" style
raised exception class EStyleException with message 'Argument must be nil'.
Aparte de los ejemplos por la web, en :
http://docwiki.embarcadero.com/Libra...nager.SetStyle
lo indica tal como lo hago:
To set the active style to the native system style, for example Windows theme, pass nil as the Style parameter.
¿Alguien sabe como asignar el estilo por defecto?.
Gracias a todos.

Última edición por Casimiro Notevi fecha: 15-05-2016 a las 17:15:45.
Responder Con Cita