TabControl控件中。Tabs里添加了几行后。用什么事件来分别控制选中不同的Tab时的响应事件!后续问题陆续提出!

解决方案 »

  1.   

    OnChange事件,通过当前的tabcontrol1.TabIndex判断
      

  2.   

    procedure TForm1.TabControl1Change(Sender: TObject);
    begin
    if form1.TabControl1.TabIndex=2 then
       showmessage('你选中的是第三页');
    end;
    //不知是不是楼主要的
      

  3.   

    >>>>>>>>>>>你的分很容易賺啊!!!procedure TForm1.PageControl1Change(Sender: TObject);
    begin
      showmessage(tpagecontrol(sender).ActivePage.Caption);
      showmessage(tpagecontrol(sender).Pages[  tpagecontrol(sender).ActivePageIndex].Caption);
    end;
    >>>>>>>>>>>Fires after a tab has been selected.type
      TNotifyEvent = procedure(Sender: TObject) of object;
    property OnChange: TNotifyEvent;Description
    Write an OnChange event handler to perform specific actions each time after a tab has been selected.  This event also fires after all tabs have been deselected.  The currently selected tab index can be obtained via the TabIndex property.  The Sender parameter specifies the tab control, whose selected tab has been changed.This event allows you to update a tab control each time the selected tab changes.  This is required by the TcxTabControl control since its page must be updated manually when a user selects a tab.
      

  4.   

    能学好DELPHI的话,这点分算什么?分有什么用的?
      

  5.   

    tabcontrol1.TabIndex判断 当前所选取的是哪一个,TAB ;
      上面也说得很清楚喔,
      

  6.   

    to:bmwyc(汗血宝马)说得不错,推荐几本好的!
      

  7.   

    还有问题呀,怎么没有人来回答的?1.怎样让程序在刚开始执行时有一个逐渐显示的过程,见过人家的程序在关闭时会逐渐消失的!
    那就应该可以逐渐显示的!2.想让程序出现一个倒计时,如30秒内没有鼠标和键盘的操作,就会自动退出.如果有操作,就退出倒计时!同时,把倒计时的时间显示到LABEL上!
      

  8.   

    我也来搞点分用用;
    窗口关闭时,从右至左拉幕式关闭.
    ANimateWindow(handle,500,AW_HOR_NEGATIVE+AW_Hide+AW_SLIDE);关于倒计时:用一个timer控件就可以,很简单的,试试.
      

  9.   

    我十初学者,请高手指教啊!在dephi中使用ADO访问数据库
    不在图形界面下选择数据源
    而是通过代码指定:
    ADOTable1.ConnectionString:='Provider=MSDASQL.1;Password=1234;Persist Security Info=True;User ID=test;Data Source=DM4;Initial Catalog=TEST';
    怎么连不上去啊?
    老是报错。
      

  10.   

    应该没错呀,我用的是ADOConnection就没问题