初學delphi,一個數據庫小程序,其中用了一個TDBNavigator(太醜了),我現在想要把TDBNavigator的visible屬性設為false,並且用其它的幾個按鈕代替,怎樣才能讓按鈕的onclick事件關聯到TDBNavigator上的某個子按鈕(如edit,懶得從寫代碼: )),各位高人幫幫忙~~~~~~~

解决方案 »

  1.   

    如果认为dbnavigator太 丑了,可可以把它的图标换掉的呀它的图标文件在:你的DELPHI的安装目录下的bin\controls.res文件中,用DELPHI的IMAGEEDIT就可以编辑如果想要用BUTTON来代替的话,可以用下面的代码:procedure TForm1.Button1Click(Sender: TObject);
    begin
      dbnavigator1.OnClick(Sender,nbedit);
    end;
    这是关于TNavigatorbtn的说明:UnitDBCtrlstype TNavigateBtn = (nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh);DescriptionEach TNavigateBtn value identifies a different button that can appear on a TDBNavigator object. The following table lists all the button types, their corresponding TNavigateBtn values, and the action associated with each button:Button Value ActionFirst nbFirst Go to the first record
    Prior nbPrior Go to the previous record
    Next nbNext Go to the next record
    Last nbLast Go to the last record
    Insert nbInsert Insert a blank record
    Delete nbDelete Delete the current record
    Edit nbEdit Permit users to edit the current record
    Post nbPost Post the current record
    Cancel nbCancel Cancel the current edit
    Refresh nbRefresh Refresh the data in the dataset
      

  2.   

    同意Drate(鸟窝里的虫) 的意见,你是否觉得,TNavigator的图表丑陋,如果干脆不用Tnavigator控件,也可以自己定义一堆按钮,写代码啊,不必要将它隐藏,还要用它。
      

  3.   

    我用了N多的TDBLookupComboBox和TDBLookupListBox,寫代碼太煩了~~~~~~~~