不通过标题拦上的最小化,最大化按钮,通过button 按钮来实现最小化,最大化,并且能
恢复到默认的窗口。另一个问题是怎样改变dbgrid里选择是行的颜色,当dbgrid的属性
rowselect 为真的时候,程序运行我们点击dbgrid的记录时,是一个兰色的行,怎样改变这个颜色

解决方案 »

  1.   

    1.
     showwindow(form1.Handle,SW_MINIMIZE);
      showwindow(form1.Handle,SW_MAXIMIZE);
      showwindow(form1.Handle,SW_RESTORE);
      

  2.   

    改变dbgrid颜色,有很多现成的控件
    到这个网站看看
    http://www.vclxx.org/DELPHIGB/DEFAULT.HTM
      

  3.   

    if (state=[gdfocused]) or (state=[gdselected,gdfocused]) then
        if not form1.DBGrid1.SelectedRows.CurrentRowSelected then
        begin
        form1.DBGrid1.Canvas.Brush.Color:=clred;
        end;
       form1.DBGrid1.Canvas.Pen.Mode:=pmMask;
        form1.DBGrid1.DefaultDrawColumnCell(rect,datacol,column,state);
      

  4.   

    DBGrid问题:只要你在
    Dbgrid的DrawColumnCell事件中加入以下代码就可以了:If Query.fieldbyname('字段名').values 满足条件 then  Begin    Dbgrid.Canvas.Brush.Color := 颜色(如:clInfoBk) ;    Dbgrid.DefaultDrawColumnCell( Rect, DataCol, Column,[gdFixed,gdFocused,gdSelected] );  End ;
      

  5.   

    在procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
      DataCol: Integer; Column: TColumn; State: TGridDrawState);事件下写
      

  6.   

    DBGrid问题:
    在DBGrid1DrawColumnCell中,这样就可以了。
      if (Rect.Top = TStringGrid(DBGrid1).CellRect(TStringGrid(DBGrid1).col,TStringGrid(DBGrid1).row).top) and       (not (gdFocused in State)) then    Dbgrid1.Canvas.Brush.Color := clRed;  DBGrid1.DefaultDrawDataCell(Rect, Column.Field, State);
      

  7.   

    Tform类有最大化最小化的方法,可以在button的onclick事件中调用直接调用
      

  8.   

    还可以这样:
    只要你在
    Dbgrid的DrawColumnCell事件中加入以下代码就可以了:If Query.fieldbyname('字段名').values 满足条件 then  Begin    Dbgrid.Canvas.Brush.Color := 颜色(如:clInfoBk) ;    Dbgrid.DefaultDrawColumnCell( Rect, DataCol, Column,[gdFixed,gdFocused,gdSelected] );  End ;