fontstyle是集合吧[fsbold,fsita..]
var
pfont:Tfontstyle;
begin
...
xx:=reg.writestring('fontstyle');
if pos('fsbold',xx)<>0 then
  pfont=[fsbold]
if pos('fsitla..',xx)<>0 then
  pfont:=pfont+[fsbold]
做过的,忘了,大概这个样子,你试试看

解决方案 »

  1.   


    const
      FontStyleNames: array [TFontStyle] of String = ('Bold', 'Italic', 'Underline', 'StrikeOut');procedure WriteFontStylesToReg( AFont: TFont; reg: TRegistry );
    var
      fs: TFontStyle;
    begin
      for fs:=Low(TFontStyle) to High(TFontStyle) do
        reg.WriteBool( FontStyleNames, fs in AFont.Style );
    end;procedure ReadFontStylesFromReg( AFont: TFont; reg: TRegistry );
    var
      fs: TFontStyle;
      FStyle: TFontStyles;
      
      procedure ReadAFontStyle( const StyleName: String; StyleValue: TFontStyle );
      begin
        if reg.ValueExists(StyleName) and reg.ReadBool(StyleName) then
          Include( FStyle, StyleValue )
        else
          Exclude( FStyle, StyleValue );
      end;
      
    begin
      FStyle := AFont.Style;
      for fs:=Low(TFontStyle) to High(TFontStyle) do
        ReadAFontStyle( FontStyleNames, fs );
      AFont.Style := FStyle;
    end;写时:
    WriteFontStylesToReg( Control1.Font, reg );
    读时:
    ReadFontStylesFromReg( Control1.Font, reg );
      

  2.   

    谢谢agui(阿贵) 啊!!我发个帖子你来接分啊^_*但是怎么没人来第二个问题呢??
      

  3.   

    请楼上的两位到http://www.csdn.net/expert/topic/393/393697.shtm接分呀^_*
      

  4.   

    2:
    既然是三层,有两个办法实现模糊查询:
    a.设置TDataSetProvider的Option为poAllowCommandText,这时在客户端便可以使用SQL语句:
    ClientDataSet.CommandText := 'Select * from table where a like '%ss%';
    ClientDataSet.Close;
    ClientDataSet.Open;b.调用中间层接口:
    SocketConnection1.Appserver.MySql('Select * ....');
    ClientDataSet.Close;
    ClientDataSet.Open;
    中间层MySQL函数:
    procedure MySQL(s: string);
    begin
      query1.close;
      query1.sql.text := s;
      Query1.Open;
    end;
    不知这样回答,你是否满意?
      

  5.   

    我的不是三层架构的~~ 只是因为如果用了BDE,加上那么多DLL文件,程序就很大了啊~~我那数据库文件也只有几十K~~用的是平面文件还是谢谢Clus(叶不归) 先呀!!PS:我用agui(阿贵) 的方法,已经成功解决了第一个问题^_*
      

  6.   

    先把Text字段的值读出来,再pos