一直没有把样式表系统一下, 春节假期有空, 不能再等了.

为了方便学习, 先写了一个样式表测试工具: CssTest(点击下载:
附件: 亲,您没有权限下载或查看附件喔:-) 试试登录注册吧!
)
--------------------------------------------------------------------------------

工具非常简单, 写了 10 行左右的代码; 运行效果图:

图解 CSS (1): 先做一个样式表测试工具_13435

--------------------------------------------------------------------------------

代码文件:
--------------------------------------------------------------------------------
  1. unit Unit1;

  2. interface

  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, ExtCtrls, StdCtrls, ComCtrls, OleCtrls, SHDocVw;

  6. type
  7.   TForm1 = class(TForm)
  8.     Memo1: TMemo;
  9.     Splitter1: TSplitter;
  10.     Panel1: TPanel;
  11.     WebBrowser1: TWebBrowser;
  12.     procedure FormCreate(Sender: TObject);
  13.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  14.     procedure Memo1Change(Sender: TObject);
  15.   end;

  16. var
  17.   Form1: TForm1;

  18. implementation

  19. {$R *.dfm}

  20. procedure TForm1.FormCreate(Sender: TObject);
  21. var
  22.   path: string;
  23. begin
  24.   Text := 'CssTest';
  25.   WebBrowser1.Navigate('about:blank');
  26.   Memo1.ScrollBars := ssBoth;
  27.   with Memo1.Font do begin
  28.     Name := 'Verdana';
  29.     Size := 10;
  30.     Color := $000080;
  31.   end;
  32.   path := ChangeFileExt(ParamStr(0),'.dat');
  33.   if FileExists(path) then ReadComponentResFile(path, Memo1);
  34. end;

  35. procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  36. begin
  37.   WriteComponentResFile(ChangeFileExt(ParamStr(0),'.dat'), Memo1);
  38. end;

  39. procedure TForm1.Memo1Change(Sender: TObject);
  40. begin
  41.   WebBrowser1.Navigate('about:' + Memo1.Text);
  42. end;

  43. end.
复制代码
--------------------------------------------------------------------------------

窗体文件:
--------------------------------------------------------------------------------
  1. object Form1: TForm1
  2.   Left = 0
  3.   Top = 0
  4.   ActiveControl = Memo1
  5.   Caption = 'Form1'
  6.   ClientHeight = 231
  7.   ClientWidth = 439
  8.   Color = clBtnFace
  9.   Font.Charset = DEFAULT_CHARSET
  10.   Font.Color = clWindowText
  11.   Font.Height = -11
  12.   Font.Name = 'Tahoma'
  13.   Font.Style = []
  14.   OldCreateOrder = False
  15.   OnClose = FormClose
  16.   OnCreate = FormCreate
  17.   PixelsPerInch = 96
  18.   TextHeight = 13
  19.   object Splitter1: TSplitter
  20.     Left = 241
  21.     Top = 0
  22.     Height = 231
  23.     MinSize = 1
  24.     ExplicitLeft = 219
  25.     ExplicitHeight = 196
  26.   end
  27.   object Memo1: TMemo
  28.     Left = 0
  29.     Top = 0
  30.     Width = 241
  31.     Height = 231
  32.     Align = alLeft
  33.     Lines.Strings = (
  34.       'Memo1')
  35.     TabOrder = 0
  36.     OnChange = Memo1Change
  37.   end
  38.   object Panel1: TPanel
  39.     Left = 244
  40.     Top = 0
  41.     Width = 195
  42.     Height = 231
  43.     Align = alClient
  44.     BevelOuter = bvNone
  45.     Caption = 'Panel1'
  46.     TabOrder = 1
  47.     object WebBrowser1: TWebBrowser
  48.       Left = 0
  49.       Top = 0
  50.       Width = 195
  51.       Height = 231
  52.       Align = alClient
  53.       TabOrder = 0
  54.       ExplicitLeft = 88
  55.       ExplicitTop = 88
  56.       ExplicitWidth = 300
  57.       ExplicitHeight = 150
  58.       ControlData = {
  59.         4C00000027140000E01700000000000000000000000000000000000000000000
  60.         000000004C000000000000000000000001000000E0D057007335CF11AE690800
  61.         2B2E126208000000000000004C0000000114020000000000C000000000000046
  62.         8000000000000000000000000000000000000000000000000000000000000000
  63.         00000000000000000100000000000000000000000000000000000000}
  64.     end
  65.   end
  66. end
复制代码
图解 CSS 系列
TOP

深情顶帖,楼主加油!
TOP

深情顶帖,楼主加油!
TOP

深情顶帖,楼主加油!
TOP

啊啊沙发沙发
TOP

谢谢分享

谢谢分享!
TOP

看不到图片,连接不到?
TOP

谢谢楼主,学习了
TOP

fffffffffffffffffff

ffffffffffffffffff
TOP