我的email是
[email protected]
谢谢
或者告诉我那里可以下载到开发代码的组件
没有开发代码的不要

解决方案 »

  1.   

    如果你想看一个控件的原始代码,在DELPHI中就可以看到,他比任何高手写的组件都要来得高点,呵呵比如你想看Tdbgrid组件的原代码,只要在你的单元文件的定义部分找到TdbGrid这几个字,按住ctrl键,然后鼠标单击Tdbgrid,就可以看到你的原始实现代码. 
      

  2.   

    我知道
    我已经研究累一段时间了
    虽然并没有写自己的什么组件
    但我觉的DELPHI的代码还是比较有难度
    有没有朋友写的发些来看
      

  3.   

    什么意思啊,编写组件不一定都要用底层和API,你也可以使用继承等等
      

  4.   

    他比任何高手写的组件都要来得高点??呵呵,可不能这么决对噢,正如 firetoucher(蹈火者) 所说,
    可以使用继承
    给你一个{ TOvrEdit
      --------
      An improved TEdit component which reflect keyboard
      insert/overwrite mode, Special desiged for Windows
      Traditional Chinese Version.  by Wolfgang Chien <[email protected]>
    }
    unit OEdit;interface{$ifdef Windows}
    uses
      SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics,
      Controls, Forms, Dialogs, StdCtrls;
    {$endif}{$ifdef Win32}
    uses
      SysUtils, Windows, Messages, Classes, Graphics,
      Controls, Forms, Dialogs, StdCtrls;
    {$endif}type
      TInsertKeyStates = (iksInsert, iksOverWrite);  TOvrEdit = class(TEdit)
      private
        FTabOnEnter: boolean;
        FInsertKeyState: boolean;
        procedure WMChar(var Msg: TWMKey); message WM_Char;
      protected
        procedure KeyDown(var Key: Word; Shift: TShiftState); override;
        procedure KeyPress(var Key: Char); override;
        function GetInsertKeyState: TInsertKeyStates;
      public
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
        property InsertKeyState: TInsertKeyStates read GetInsertKeyState;
      published
        property TabOnEnter: boolean
          read FTabOnEnter write FTabOnEnter default True;
      end;procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('Samples', [TOvrEdit]);
    end;constructor TOvrEdit.Create(AOwner: TComponent);
    begin
      inherited Create(AOwner);
      TabOnEnter := True;
    end;(* -------------------------------------------------- *)
    destructor TOvrEdit.Destroy;
    begin
      inherited Destroy;
    end;(* -------------------------------------------------- *)
    procedure TOvrEdit.KeyDown(var Key: Word;
      Shift: TShiftState);
    begin
      if TabOnEnter then
      begin
        case Key of
          vk_Down:  { Dn-Arrow Key }
            begin
              SendMessage(GetParentForm(Self).Handle, wm_NextDlgCtl, 0, 0);
              Key := 0;
            end;
          vk_Up:  { Up-Arrow Key }
            begin
              SendMessage(GetParentForm(Self).Handle, wm_NextDlgCtl, 1, 0);
              Key := 0;
            end;
        end;
      end;
      if Key <> 0 then inherited KeyDown(Key, Shift);
    end;(* -------------------------------------------------- *)
    procedure TOvrEdit.KeyPress(var Key: Char);
    begin
      if TabOnEnter and (Key = #13) then { Enter Key }
      begin
        SendMessage(GetParentForm(Self).Handle, wm_NextDlgCtl, 0, 0);
        Key := #0;
      end;
      if Key <> #0 then inherited KeyPress(Key);
    end;(* -------------------------------------------------- *)
    function TOvrEdit.GetInsertKeyState: TInsertKeyStates;
    begin
      if GetKeyState(VK_INSERT) = 0 then
        Result := iksInsert
      else
        Result := iksOverWrite;
    end;(* -------------------------------------------------- *)
    procedure TOvrEdit.WMChar(var Msg: TWMKey);
    begin
      { if Overwrite state and user select nothing }
      if (InsertKeyState = iksOverWrite) and (SelLength = 0)
        and (SelStart < GetTextLen) then
      begin
        { ASCII Extend code > 127 ==> Chinese word Lead-byte, BIG-5 }
        if Msg.CharCode > 127 then
          SelLength := 2
        else
        begin
          SelLength := 2;
          { if char on current Caret positon is a Chinese word }
          if Ord(SelText[1]) > 127 then
            SelLength := 2
          else
            SelLength := 1;
        end;
      end;  inherited;
    end;end.