如何禁用TFileOpenDialog和TOpenDialog的Vcl主题?
我试试
procedure TForm1.FormCreate(Sender: TObject); var chosenDirectory: String; openDialog : TFileOpenDialog; begin TStyleManager.Engine.RegisterStyleHook(TFileOpenDialog, TStyleHook); chosenDirectory:=''; try openDialog:=TFileOpenDialog.Create(Self); openDialog.Options := [fdoPickFolders]; // var 2 // Not works //TStyleManager.Engine.RegisterStyleHook(TFileOpenDialog, TStyleHook); if openDialog.Execute then chosenDirectory:=openDialog.FileName; finally openDialog.Free; end; end;
但它不起作用.我尝试变异2.它也不起作用.
禁用常用对话框样式的正确方法是删除TStyleManager.SystemHooks属性的shDialogs元素 .
TStyleManager.SystemHooks := [shMenus, shToolTips];