Silverlight 4 的Host HTML功能介绍
Silverlight 4新功能: Host HTML Content.
这个新功能挺不错的,可惜的是它只能是你把SilverLight应用程序安装到客户端才能使用,不明白为什么SilverLight Toolkit团队不让它能够在浏览器中也可以用。
看了段视频,它主要是讲了三个应用,其它还有很多使用这个功能的方法你可以试着在下面给我留言,大家一起学习。
首先是创建一个SL 4的应用程序,起名字为HostHTMLContent;如下图:
然后在MainPage.xaml页面的根Grid下添加一个StackPanel,居中显示,接着是在StackPanel中放一个Grid来显示HTML Content,这个Grid定义为4行两列:
<Grid x:Name="LayoutRoot" Background="Gray">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="ControlSamples">
<Grid Width="600">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="520*"/>
<ColumnDef
相关文档:
//回车:[\n\r\t]
$reg="|typeid=\"(.*)\" onsel.*[\n\r\t]*<a href="\" mce_href="\""#\">(.*)</a>|";
preg_match_all ($reg,
$html,
$out, PREG_PATTERN_ORDER);
foreach ($out as $value){
foreach ($value as $value2){
if(strlen($value2)<20)
echo ($value2."<br>");
}
} ......
<html:select property='optdwdm' style='width:230' onchange='changedw(this)'>
<html:options collection='dwlist' property='dm' labelProperty='mc' />
</html:select>
在标签的 ONCHANGE 事件里面定义一个 changedw(this)
然后可以通过以下代码获取 html:select 选取的 VALUE ......
<mce:style type="text/css"><!--
#summary{word-wrap:break-word;width:500px;margin: 0px;padding: 0px;};
.formIn th{white-space: nowrap;}
.formIn{ margin-left: 90px;}
--></mce:style><style type="text/css" mce_bogus="1"> #summary{word-wrap:break-word;width:50 ......
1.防止图片被下载和盗用的方法:
(1)<div>嵌套<img>设置<div>的背景图片为实际图片,<img>包含的图片是一张透明图片,两张图片的尺寸相同。即相当于在真实图片上添加了一层保护膜,这张保护膜就是透明图片。这样当用户选择“图片另存为”时,将保存的是透明图片,而不是实际图 ......
<html >
<body style="margin:0;overflow:hidden">
<div>
<table style="width:100%;height:100%">
<!--<tr>
& ......