Delphi HTML code

Source: Internet
Author: User

############################### #属性 Settings ################################################

Font settings {
//---------------------------------------------------------------------------------------
Font name <font face= Microsoft ya Black >this A text</font>
Font size <font size=1><span style= "font-size:100pt" ><p>this A Text</p></span></font >
//---------------------------------------------------------------------------------------
Bold <strong>this A text</strong>
Italic <em>this A text</em>
Underline <u>this A text</u>
Strikethrough <s>this A text</s>
//---------------------------------------------------------------------------------------
Font Color <font color= #ff0000 >this A text</font>
Font background color <font style= "Background-color: #0000ff" >this A text</font>
//---------------------------------------------------------------------------------------
}

//---------------------------------------------------------------------------------------
Font style {
HTML code-style settings pastehtml
How to get

General <p>this is a text</p>
Formatted <pre>this is a text</pre>
Address <address>this is a text</address>
Title 1 Title 2 Title 3 Title 4 Title 5 Title 6 Numbered List <ol><li><p>this is a text</p></li></ol>
Bulleted list <ul><li><p>this is a text</p></li></ul>
Directory list <dir><li><p>this is a text</p></li></dir>
Menu List <menu><li><p>this is a text</p></li></menu>
Definition entry <dl><dt>Definition <dl><dd>Paragraph <dl><dd><p>this is a text</p></dd></dl>
}
//---------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------
Alignment {
Left <p Align=left>this is A text</p>
<p Align=center>this is A text</p>
Right <p Align=right>this is A text</p>
Both ends <p align= "Justify" >this is A text</p>
}
//---------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------
Sequence
Digital sequence <OL><LI> This is A text</li></ol>
Origin sequence <UL><LI> This is A text</li></ul>
}
//---------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------
Indent {
Move right.
Move left.
//---------------------------------------------------------------------------------------
Indent Right 2 times
<blockquote style= "margin-right:0px" dir=ltr>
<blockquote style= "margin-right:0px" dir=ltr>
<p style= "margin-right:0px" Dir=ltr>this is A text</p></blockquote></blockquote>
The text is on the far left.
<p style= "margin-right:0px" Dir=ltr>this is A text</p>

//---------------------------------------------------------------------------------------

Set Tab Size This is a Text//note There are several means tab is a few now means tab for 2 grid
}

//---------------------------------------------------------------------------------------
Superscript/Subscript {
Superscript <sup>aaaaaaaaa</sup>
Subscript <sub>aaaaaaaaa</sub>
Normal clear style
}
//---------------------------------------------------------------------------------------

web{
Web background color <body bgcolor= #000080 >
Web background image <body background=c:\1.jpg >


}
//---------------------------------------------------------------------------------------

Insert Picture {



}
//---------------------------------------------------------------------------------------

Insert Hyperlink {
Insert
Delete
Title is a hint message
HTTPS https://
<a href= "https://www.baidu.com" title= "hint info" >Hello</a>
FILE file://
<a href= "File://C:/1.avi" title= "hint info" >Hello</a>
FTP ftp:///
<a href= "Ftp:///C:/1.avi" title= "hint info" >Hello</a>
HTTP http:///
<a href= "Http:///C:/1.avi" title= "hint info" >Hello</a>
Mail Recipient Mailto:mainto OutLook Express
<a href= "Mailto:[email protected]" title= "message" >Hello</a>
News news:/
<a href= "News:/c:/1.avi" title= "hint info" >Hello</a>
Telnet telnet:/
<a href= "Telnet:/c:/1.avi" title= "hint info" >Hello</a>
Other
<a href= "/c:/1.avi" title= "Hint" >Hello</a>
}
//---------------------------------------------------------------------------------------

Insert Bookmark {

}
//---------------------------------------------------------------------------------------

Insert Multimedia {
Media
Real
Flash
}

//---------------------------------------------------------------------------------------

Insert Table {


}
//---------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------
Insert of HTML Component {

}

//---------------------------------------------------------------------------------------
Create a new 1 empty document

//---------------------------------------------------------------------------------------
File
New Document
Save document
Save document
Open Document
Print
Print Preview
Page Setup
View document source files
Write to source file
}


Edit
Revoke
Redo
Copy
Paste
Delete
Select All
Shear
Find
Replace
}
//---------------------------------------------------------------------------------------
State
Document title
Whether the document has been modified
Document size
The selected text
Set the selected text


}
//---------------------------------------------------------------------------------------

############################### #属性 Get ################################################











//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
How to use
1 Get the current selected text position
2 implementing features by pasting HTML code
3 Select the original selected text again after completing the command



//---------------------------------------------------------------------------------------
Get the currently selected text
functionGetSelText ():string;
begin
Result:= ((Form1.WebBrowser1.Document as IHTMLDocument2). Selection.createrange as IHTMLTxtRange). Text;
End;
//---------------------------------------------------------------------------------------
Paste HTML code
procedureSetselhtmltext (S:string);
begin
(Form1.WebBrowser1.Document as IHTMLDocument2). Selection.createrange as IHTMLTxtRange). pastehtml (s);
End;
//---------------------------------------------------------------------------------------
Set text to be selected
procedureSetSelection (Start,length:integer);
var
Textrange:ihtmltxtrange;
Doc:ihtmldocument2;
begin
(Form1.WebBrowser1.Document as IHTMLDocument2). Selection.empty;
Textrange:= (Form1.WebBrowser1.Document as IHTMLDocument2). Selection.createrange as IHTMLTxtRange;
Textrange.collapse (TRUE);
Textrange.moveend (' character ', start+length);
Textrange.movestart (' character ', Start);
Textrange.select;
End;
//---------------------------------------------------------------------------------------
Get text to be selected location



//---------------------------------------------------------------------------------------
Set HTML to Normal
This is achieved by acquiring attributes.


//---------------------------------------------------------------------------------------


From for notes (Wiz)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.