每日一帖delphi示例程序

时间:2010-01-30 12:18:40  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:fe2a4638.gif" />PAS源码:每日一帖示例图片unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialog...
  正文:最近在程序中增加了每日一帖的功能,搜索一下网站的程序,发现大部分是用Memo实现,而我用的是TWebBrowser基于HTML做,故帖出来共享一下。
PAS源码:
每日一帖示例图片


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, StdCtrls, ExtCtrls, ComCtrls,
ToolWin, Buttons, Menus, ImgList, IniFiles;

type
TForm1 = class(TForm)
ImageList1: TImageList;
MainMenu1: TMainMenu;
mnuSystem: TMenuItem;
mnuChangephotoshop/ target=_blank class=infotextkey>psw: TMenuItem;
mnuLogin: TMenuItem;
N2: TMenuItem;
mnuExit: TMenuItem;
mnuEdit: TMenuItem;
mnuCut: TMenuItem;
mnuCopy: TMenuItem;
mnuPaste: TMenuItem;
mnuView: TMenuItem;
mnuToolBarShow: TMenuItem;
mnuStatusBarShow: TMenuItem;
mnuTipsShow: TMenuItem;
mnuTools: TMenuItem;
mnuCheckUpdate: TMenuItem;
N6: TMenuItem;
mnuOA: TMenuItem;
mnuCalcator: TMenuItem;
mnuNotePad: TMenuItem;
mnuCalendar: TMenuItem;
mnuWindows: TMenuItem;
mnuHorizontalTitle: TMenuItem;
mnuVerticalTitle: TMenuItem;
mnuCascade: TMenuItem;
mnuArrangeIcons: TMenuItem;
mnuHelp: TMenuItem;
mnuHelpContents: TMenuItem;
mnuAbout: TMenuItem;
ControlBar1: TControlBar;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
Timer1: TTimer;
Splitter1: TSplitter;
StatusBar1: TStatusBar;
pnlLeft: TPanel;
pnlTips: TPanel;
Image1: TImage;
Label1: TLabel;
SpeedButton1: TSpeedButton;
WebBrowser1: TWebBrowser;
Timer2: TTimer;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure mnuTipsShowClick(Sender: TObject);
procedure TipTimerInit(Sender: TObject);
procedure ShowNextTips(Sender: TObject);
procedure pnlTipsResize(Sender: TObject);
private
IniSetting: TIniFile;

public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

{========================================================================
  DESIGN BY :  彭国辉
  DATE:        2005-02-25
  SITE:        http://kacarton.yeah.net/
  BLOG:        http://blog.csdn.net/nhconch
  EMAIL:       kacarton#sohu.com

  文章为作者原创,转载前请先与本人联系,转载请注明文章出处、保留作者信息,谢谢支持!
=========================================================================}


procedure TForm1.FormCreate(Sender: TObject);
begin
  IniSetting := TIniFile.Create(ExtractFilePath(Application.ExeName) +  'setting.ini');
  pnlTips.Height := IniSetting.ReadInteger('Tips', 'TipHeight', pnlTips.Height);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  IniSetting.WriteInteger('Tips', 'TipHeight', pnlTips.Height);
  IniSetting.WriteInteger('Tips', 'TipIndex', Timer2.Tag);
  IniSetting.WriteBool('Tips', 'ShowTips', pnlTips.Visible);
  IniSetting.Free;
end;

procedure TForm1.mnuTipsShowClick(Sender: TObject);
begin
  pnlTips.Visible := not pnlTips.Visible;
  Splitter1.Visible := pnlTips.Visible;
  mnuTipsShow.Checked := pnlTips.Visible;
  IniSetting.WriteBool('Tips', 'ShowTips', pnlTips.Visible);
  if pnlTips.Visible then begin
    WebBrowser1.Navigate('About:正在载入资料...');
    ShowNextTips(Timer2);
  end;
  Timer2.Enabled := pnlTips.Visible;
end;
每日一帖delphi示例程序》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/Delphi/12651.html

 1/4    1 2 3 4 下一页 尾页


关键字:

关于《每日一帖delphi示例程序》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td