亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dbgrid.htm

?? 對于學習很有幫助
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
      or (flds = '') then begin
        CancelRange;
      end else begin
        SetRangeStart;
        for i := 1 to n do begin
          val := Cells[1,i];
          if val <> '' then begin
            FieldByName(Cells[0,i]).AsString := val;
          end;
        end;

        SetRangeEnd;  { Set range end to match range start }
        for i := 1 to n do begin
          val := Cells[1,i];
          if val <> '' then begin
            FieldByName(Cells[0,i]).AsString := val;
          end;
        end;
        ApplyRange;
      end;

      Refresh;
    end;  { with CallingGrid.DataSource.DataSet }
  end;  { with dlgQBF.gridQBF }

  dlgQBF.Hide;
end;

end.
</PRE><HR>

<H1><A NAME="dbgrid6">DBGRID saving the user configuration</A></H1>
<I>[Cosimo Laddomada, mimmoladd@mail.clio.it]</i><p>


<PRE>Is their a way to save the column order of a grid after the user
reorders the columns via drag n drop.</PRE>

I resolved this problem time ago for my one application. Following code is
adapted for you, not tested, but I think it works fine. It create, save and
load configuration's file for order AND SIZE too of fields. I'm at your
disposal for further into something. <p>

<HR><pre>
procedure TMainForm.NewIni(const NomeIni: string);
var F: System.Text;
    i: Byte;
begin
  System.Assign(F, NomeIni);
  System.ReWrite(F);
  System.WriteLn(F, '[Campi_Ordine]');
  for i:=1 to Table1.FieldCount do
    System.WriteLn(F, 'Campo',i,'=',Table1.Fields[i-1].FieldName);
  System.WriteLn(F, '');
  System.WriteLn(F, '[Campi_Size]');
  for i:=1 to Table1.FieldCount do
    System.WriteLn(F, 'Campo',i,'=',Table1.Fields[i-1].DisplayWidth);
  System.Close(F);
end;

procedure TMainForm.SaveIni(const FN: String);
var Ini: TIniFile;
    i: Integer;
begin
  NewIni(FN);
  Ini := TIniFile.Create(FN);
  with Ini do
  begin
    for i:=1 to Table1.FieldCount do
    begin
      S:= Table1.Fields[i-1].FieldName;
      WriteString('Campi_Ordine', 'Campo'+IntToStr(i), 
        Table1.Fields[i-1].FieldName);
      WriteInteger('Campi_Size', 'Campo'+IntToStr(i),
        Table1.Fields[i-1].DisplayWidth);
    end;
  end;
  Ini.Free;
end;

procedure TMainForm.LoadIni(const FN: String);
var Ini: TIniFile;
    i: Integer;
    j: Longint;
    S: String;

    function MyReadInteger(const Section, Ident: string): Longint;
    begin
      result := Ini.ReadInteger(Section, Ident, -1);
      if result=-1 then
        raise Exception.Create('Errore nel file di configurazione.');
    end;

    function MyReadString(const Section, Ident: string): String;
    begin
      result := Ini.ReadString(Section, Ident, '');
      if result='' then
        raise Exception.Create('Errore nel file di configurazione.');
    end;

begin
  Ini := TIniFile.Create(FN);
  try
    with Ini do
    begin
      for i:=1 to Table1.FieldCount do
      begin
        S:= MyReadString('Campi_Ordine', 'Campo'+IntToStr(i));
        j:= MyReadInteger('Campi_Size', 'Campo'+IntToStr(i));
        Table1.FieldByName(S).Index := i-1;
        Table1.FieldByName(S).DisplayWidth := j;
      end;
    end;
  finally
    Ini.Free;
  end;
end;
</PRE><HR>

<p><H1><A NAME="dbgrid7">DBGrid resize<img src="../images/new.gif" width=28 height=11 border=0 alt=" [NEW]"></p></A></H1>

<PRE>I have a form. In that an Edit field, an SQL Query, a DBGrid and a Button.
I can write into the edit, and the Query result will put into the grid.
How can I resize the grid and the form to the fields size which appears in
the grid. The fields Which I select with the query does not fill the full
size of the grid or does not fit into it.</PRE>

You can change the size of a column at run-time by changing the DisplayWidth
property of the underlying field object...<p>

<Hr><PRE>MyTableMyField.DisplayWidth := Length(MyTableMyField.value);</PRE><HR>

If you need to actually calculate the width of the entire grid, use the
following (from a tips library)...<p>

<Hr><PRE>function NewTextWidth(fntFont : TFont; const sString : OpenString) :

  integer;
var
  fntSave : TFont;
begin
  result := 0;
  fntSave := Application.MainForm.Font;
  Application.MainForm.Font := fntFont;
  try
    result := Application.MainForm.Canvas.TextWidth(sString);
  finally
    Application.MainForm.Font := fntSave;
  end;
end;


{ calculate the width of the grid needed to exactly display with no   }
{ horizontal scrollbar and with no extra space between the last       }
{ column and the vertical scrollbar.  The grid's datasource must be   }

{ properly set and the datasource's dataset must be properly set,     }
{ though it need not be open.  Note:  this width includes the width   }
{ of the vertical scrollbar, which changes based on screen            }
{ resolution.  These changes are compensated for.                     }

function iCalcGridWidth
  (
  dbg : TDBGrid { the grid to meaure }
  )
  : integer; { the "exact" width }

const
  cMEASURE_CHAR   = '0';
  iEXTRA_COL_PIX  = 4;
  iINDICATOR_WIDE = 11;

var
  i, iColumns, iColWidth, iTitleWidth, iCharWidth : integer;
begin
  iColumns := 0;
  result := GetSystemMetrics(SM_CXVSCROLL);
  iCharWidth := NewTextWidth(dbg.Font, cMEASURE_CHAR);
  with dbg.dataSource.dataSet do
    for i := 0 to FieldCount - 1 do with Fields[i] do
      if visible then
      begin
        iColWidth := iCharWidth * DisplayWidth;
        if dgTitles in dbg.Options then
        begin
          iTitleWidth := NewTextWidth(dbg.TitleFont, DisplayLabel);

          if iColWidth &lt; iTitleWidth then iColWidth := iTitleWidth;
        end;
        inc(iColumns, 1);
        inc(result, iColWidth + iEXTRA_COL_PIX);
      end;
  if dgIndicator in dbg.Options then
  begin
    inc(iColumns, 1);
    inc(result, iINDICATOR_WIDE);
  end;
  if dgColLines in dbg.Options
    then inc(result, iColumns)
    else inc(result, 1);
end;
</PRE><HR>

I had to use the function NewTextWidth, rather than the Grid's
Canvas.TextWith as the Canvas of the Grid may not initialized when you need
to call iCalcGridWidth.<p>

<P><H1><A NAME="dbgrid8">Dragging from DbGrid<IMG SRC="../images/new.gif" WIDTH=28 HEIGHT=11 BORDER=0 ALT=" [NEW]"></P></A></H1>

<PRE>Has someone achieved dragging things from a DbGrid ?
You can create your own descendant of TDBGrid (or TDBCustomGrid) and
customize it to your needs.</PRE>

<I>[Demian, demian@unix.horizontes.com.br]</I><P>
Do an Origami with the code at the end of this message, save it as DBGrid.pas,
and install it. You'll have a new component EDBGrid with two new events:
OnMouseDown and OnMouseUp.
I don't consider it a 'proprietary information': it's a Delphi Bug!
Originally, this two events should have been part of the DBGrid component.

<HR><PRE>
unit Dbgrid;

interface

uses
  DBGrids, Controls, Classes;

type
  TEDBGrid = class(TDBGrid)
  private
    FOnMouseDown: TMouseEvent;
    FOnMouseUp: TMouseEvent;
  protected
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y:
Integer); override;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y:
Integer); override;
  published
    Property OnMouseDown : TMouseEvent read FOnMouseDown write
FOnMouseDown ;
    Property OnMouseUp : TMouseEvent read FOnMouseUp write FOnMouseUp ;
end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Data Controls',[TEDBGrid]);
end;

procedure TEDBGrid.MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
begin
  if Assigned(FOnMouseDown) then
    FOnMouseDown(Self,Button,Shift,X,Y);
  inherited MouseDown(Button,Shift,X,Y);
end;

procedure TEDBGrid.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
begin
  if Assigned(FOnMouseUp) then
    FOnMouseUp(Self,Button,Shift,X,Y);
  inherited MouseUp(Button,Shift,X,Y);
end;

end.
</PRE><HR>


<HR SIZE="6" color="#00FF00">
<FONT SIZE="2">
<a href="mailto:rdb@ktibv.nl">Please email me</a> and tell me if you liked this page.<BR>
<SCRIPT LANGUAGE="JavaScript">
<!--
	document.write("Last modified " + document.lastModified);
// -->
</SCRIPT><P>
<TABLE BORDER=0 ALIGN="CENTER">
<TR>
	<TD>This page has been created with </TD>
	<TD> <A HREF="http://www.dexnet.com./homesite.html"><IMG SRC="../images/hslogo.gif" 
                     WIDTH=144 HEIGHT=64 BORDER=0>
</A></TD>
</TR>
</TABLE>

</FONT>


</BODY>
</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区三区久久久久久久久不| 欧美精品 日韩| 精品一区二区三区免费播放| 午夜电影一区二区| 亚洲第一av色| 日本午夜精品视频在线观看| 日日摸夜夜添夜夜添国产精品| 亚洲国产精品影院| 日韩成人午夜精品| 国精品**一区二区三区在线蜜桃| 精油按摩中文字幕久久| 国产酒店精品激情| 成人免费黄色大片| 色婷婷av一区二区三区软件| 欧美在线播放高清精品| 欧美肥大bbwbbw高潮| 欧美成人国产一区二区| 国产欧美日韩在线| 一区二区三区久久久| 丝袜美腿亚洲综合| 国产成人综合自拍| 99re8在线精品视频免费播放| 日本高清不卡视频| 777久久久精品| 国产午夜精品一区二区三区嫩草 | 国产精品久久久一本精品| 亚洲人一二三区| 热久久免费视频| 成人免费毛片片v| 制服丝袜激情欧洲亚洲| 亚洲国产高清aⅴ视频| 一区二区在线观看视频| 狠狠v欧美v日韩v亚洲ⅴ| 9i在线看片成人免费| 678五月天丁香亚洲综合网| 欧美国产精品劲爆| 丝袜美腿亚洲一区| av电影在线观看不卡| 欧美一级久久久| 亚洲精品综合在线| 国产成人超碰人人澡人人澡| 欧美日韩中文另类| 国产精品国产三级国产普通话三级| 亚洲成人综合在线| 92精品国产成人观看免费| 欧美一级一级性生活免费录像| |精品福利一区二区三区| 精品亚洲免费视频| 欧美军同video69gay| 亚洲你懂的在线视频| 国产风韵犹存在线视精品| 91.xcao| 亚洲男人的天堂在线观看| 国产老妇另类xxxxx| 日韩午夜av一区| 天堂精品中文字幕在线| 在线一区二区三区做爰视频网站| 国产亚洲精品精华液| 精品一区二区三区视频在线观看| 欧美日韩精品福利| 亚洲国产精品久久艾草纯爱| 色婷婷av久久久久久久| 一区二区三区鲁丝不卡| 色哟哟在线观看一区二区三区| 欧美韩国一区二区| 国产jizzjizz一区二区| 久久综合色一综合色88| 极品少妇一区二区| 精品美女一区二区| 精品一区二区三区免费| 久久综合九色综合欧美98| 久久成人久久爱| 日韩一区二区三区高清免费看看| 日韩综合在线视频| 欧美一区二区三区免费观看视频| 午夜国产精品一区| 欧美一区二区三区啪啪| 狠狠色狠狠色综合系列| 久久久亚洲精品石原莉奈| 国产一区二区三区在线观看精品| 欧美精品一区二区高清在线观看| 激情小说亚洲一区| 中文在线资源观看网站视频免费不卡| 国产成人亚洲综合a∨婷婷图片| 国产三级精品视频| 99久久国产综合精品女不卡| 日韩伦理免费电影| 欧美四级电影在线观看| 欧美a一区二区| 久久久亚洲精华液精华液精华液| 成人高清免费观看| 亚洲一区二区三区爽爽爽爽爽| 欧美高清视频不卡网| 国产在线一区二区综合免费视频| 国产精品全国免费观看高清| 色婷婷综合五月| 美女免费视频一区| 亚洲国产岛国毛片在线| 欧美视频一区二区三区在线观看| 热久久免费视频| 国产精品不卡在线| 在线电影欧美成精品| 国产精品一区二区黑丝| 一区二区三区毛片| 久久久久久久久99精品| 91麻豆精东视频| 精品在线播放免费| 亚洲精品视频在线| 久久蜜桃一区二区| 在线一区二区三区四区五区 | 国产精品99久久久久久久女警 | 欧美吞精做爰啪啪高潮| 免费在线看一区| 亚洲欧洲av一区二区三区久久| 欧美麻豆精品久久久久久| 国产成人精品免费网站| 午夜视频久久久久久| 国产精品成人网| 日韩午夜电影av| 欧美系列在线观看| 国产成人夜色高潮福利影视| 视频一区二区不卡| 日韩一区日韩二区| 精品国产91亚洲一区二区三区婷婷| 色欧美片视频在线观看在线视频| 韩国精品主播一区二区在线观看| 亚洲精品写真福利| 国产精品三级av| 久久影院午夜论| 91麻豆精品国产91久久久更新时间 | 欧美高清一级片在线| 色综合久久66| 成人免费av网站| 国产成人精品网址| 蜜臂av日日欢夜夜爽一区| 亚洲国产精品自拍| 亚洲一区影音先锋| 亚洲美女视频在线| 亚洲欧洲精品一区二区三区| 国产色一区二区| 久久久久久久久久久久久久久99| 欧美一区二区精品在线| 欧美三级蜜桃2在线观看| 91碰在线视频| 91黄色激情网站| 91麻豆免费观看| 色国产综合视频| 在线视频一区二区三| 欧美性一二三区| 色八戒一区二区三区| 日本伦理一区二区| 欧美性三三影院| 这里只有精品免费| 日韩欧美综合在线| 久久网站最新地址| 久久精品日产第一区二区三区高清版| 精品国产一区二区三区久久影院 | 国产精品2024| 国产成人日日夜夜| 不卡视频在线观看| 色婷婷久久久久swag精品| 色av成人天堂桃色av| 欧美区一区二区三区| 4438亚洲最大| 久久夜色精品国产噜噜av| 久久综合九色综合97_久久久| 国产清纯白嫩初高生在线观看91 | 狠狠色丁香久久婷婷综| 国产丶欧美丶日本不卡视频| 成人黄色软件下载| 色妹子一区二区| 91精品国产乱| 国产网站一区二区三区| 亚洲免费观看高清完整版在线| 亚洲国产精品人人做人人爽| 免费人成精品欧美精品| 国产传媒久久文化传媒| 日本二三区不卡| 亚洲精品一区二区精华| 亚洲欧洲日韩av| 蜜芽一区二区三区| 成人免费视频网站在线观看| 欧美午夜在线观看| 精品黑人一区二区三区久久| 亚洲天堂免费在线观看视频| 日本亚洲欧美天堂免费| 欧美日韩你懂的| 精品国产免费久久| 亚洲品质自拍视频网站| 男人的天堂亚洲一区| 波多野结衣精品在线| 欧美一区二区三区免费大片| 亚洲视频 欧洲视频| 美国精品在线观看| 91浏览器在线视频| 国产午夜三级一区二区三| 午夜亚洲国产au精品一区二区| 岛国av在线一区| 精品久久久三级丝袜| 一级女性全黄久久生活片免费|