1.xaml

 <UserControl xmlns:SilverlightClient="clr-namespace:SilverlightClient"  x:Class="SilverlightClient.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:SlInpu="clr-namespace:Sl.Input;assembly=Sl.Input"
mc:Ignorable="d" d:DesignWidth="" d:DesignHeight="">
<Grid x:Name="LayoutRoot">
<StackPanel>
<!--导航栏-->
<StackPanel Orientation="Horizontal" Background="WhiteSmoke">
<Button x:Name="myHTML" Content="HTML内容" FontSize=""/>
<Button x:Name="myFlash" Content="Flash" FontSize=""/>
<Button x:Name="myPDF" Content="PDF文档" FontSize=""/>
</StackPanel>
<Grid Grid.Row="" x:Name="contentLayout2" Visibility="Visible">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border x:Name="borHtmlrb" HorizontalAlignment="Stretch" Grid.Row="" Grid.Column="" Background="Red">
<SilverlightClient:ControlHtmlHost x:Name="ccc"/>
</Border>
<Border Grid.Row="" Grid.Column="" Background="Blue">
<ScrollViewer Margin="0,5,5,5">
<Grid Grid.Row="" Grid.Column="" Margin="0,5,5,5">
<Grid.RowDefinitions>
<RowDefinition Height=""/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="">
<!--<TextBox Width="" Height=""/>-->
<!--<SlInpu:SLInput x:Name="mytxt" Width="" Height="" Foreground="Red" FontSize="" ></SlInpu:SLInput>-->
<SlInpu:SLInput x:Name="mytxt1" Width="" Height="" Foreground="Red" FontSize="" ></SlInpu:SLInput>
</StackPanel>
<StackPanel Grid.Row="" HorizontalAlignment="Center" Margin="0,15,0,5">
<TextBlock x:Name="txtTimeThree" FontSize="" FontFamily="SimSun" Text=""/>
<TextBlock x:Name="txtTimeFWThree" FontSize="" FontFamily="SimSun" Text=""/>
</StackPanel>
<Border Grid.Row="" Margin="">
<Button Content="dddd" Width="" Height=""/>
</Border>
<StackPanel Grid.Row="" HorizontalAlignment="Center" Margin="0,15,0,5">
<TextBlock x:Name="txtTimeSix" FontSize="" FontFamily="SimSun" Text=""/>
<TextBlock x:Name="txtTimeFWSix" FontSize="" FontFamily="SimSun" Text=""/>
</StackPanel>
<Border Grid.Row="" Margin="">
<Button Content="dddd" Width="" Height=""/>
</Border>
</Grid>
</ScrollViewer>
</Border>
<Border x:Name="borHtmlyb" Grid.Row="" Grid.Column="" Background="Red">
<SilverlightClient:ControlHtmlHost x:Name="aaa" />
</Border>
<Border x:Name="borHtmlxb" Grid.Row="" Grid.Column="" Background="Red">
<SilverlightClient:ControlHtmlHost x:Name="bbb" />
</Border>
</Grid>
</StackPanel> </Grid>
</UserControl>

2.xaml.cs

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Divelements.SilverlightTools; namespace SilverlightClient
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
//注册事件触发处理
this.Loaded += new RoutedEventHandler(MainPage_Loaded);
this.myHTML.Click += new RoutedEventHandler(myHTML_Click);
this.myFlash.Click += new RoutedEventHandler(myFlash_Click);
this.myPDF.Click += new RoutedEventHandler(myPDF_Click);
} void MainPage_Loaded(object sender, RoutedEventArgs e)
{
//GetRichContent("http://cn.bing.com", UriKind.Absolute);
} void myPDF_Click(object sender, RoutedEventArgs e)
{
//GetRichContent("/test.pdf",UriKind.Relative);
//InitHtml();
//MessageBox.Show(mytxt.Text);
} void myFlash_Click(object sender, RoutedEventArgs e)
{
//GetRichContent("/clock.swf", UriKind.Relative);
} void myHTML_Click(object sender, RoutedEventArgs e)
{
GetRichContent(aaa, "/YB.HTM", UriKind.Relative);
GetRichContent(bbb, "/YB.HTM", UriKind.Relative);
GetRichContent(ccc, "/XB.HTM", UriKind.Relative);
}
private void InitHtml()
{
GetRichContent(borHtmlrb, "/DQ.HTM", UriKind.Relative);
GetRichContent(borHtmlyb, "/YB.HTM", UriKind.Relative);
GetRichContent(borHtmlxb, "/XB.HTM", UriKind.Relative);
}
private void GetRichContent(Border name, string uri, UriKind uk)
{
ControlHtmlHost chtml = new ControlHtmlHost();
HtmlHost hh = chtml.FindName("htmlHost") as HtmlHost;
hh.SourceUri = new Uri(uri, uk);
name.Child = chtml;
}
//获取Rich Content
void GetRichContent(ControlHtmlHost chtml, string uri, UriKind uk)
{
HtmlHost hh = chtml.FindName("htmlHost") as HtmlHost;
hh.SourceUri = new Uri(uri, uk); }
}
}

3.添加引用Divelements.SilverlightTools.dll
4.设置启动页面  <param name="windowless" value="true" />

以上是设置silverlight嵌套html文件

5.添加Sl.Input.dll引用

6.在xaml里添加<SlInpu:SLInput x:Name="mytxt1" Width="220" Height="150" Foreground="Red" FontSize="18" ></SlInpu:SLInput>

7.在百度网盘里搜索slInput.rar

8.有需要类库的朋友,请给我留言。。。。

silverlight嵌套html不能输入中文问题的更多相关文章

  1. silverlight 不能输入中文问题

    <param name="Windowless" value="true" />将调用silverlight页面的这句删除掉应该就能解决问题了 1. ...

  2. ios 一个正则表达式测试(只可输入中文、字母和数字)

    一个正则表达式测试(只可输入中文.字母和数字) 在项目中碰到了正则表达式的运用,正则还是非常强大的,不管什么编程语言,基本上都可以用到.之前在用java时特别是对用户名或密码使用正则非常爽,写 脚本上 ...

  3. Debain下解决sublime无法输入中文

    sublime安装的方法在此不做过多介绍,网上有很多中教程的方式.本文描述在已经安装sublime的前提下如何输入中文. 1.保存下面的代码到文件sublime_imfix.c(位于~目录) #inc ...

  4. xshell不能输入中文,显示为??

    不知不觉间发现自己使用xshell的时候不能输入中文了,输入的中文会变成"??",开始以为是编码问题,看了一下编码设置后发现没有任何问题,而且显示中文没有出现乱码问题,只是在输入的 ...

  5. js控制文本框只能输入中文、英文、数字与指定特殊符号.

    先在'' 里输入 onkeyup="value=value.replace(/[^\X]/g,'')" 然后在(/[\X]/g,'')里的 X换成你想输入的代码就可以了, 中文u4 ...

  6. sublime_text_2 ubuntu下无法输入中文 解决方法

    参考资料:http://my.oschina.net/wugaoxing/blog/121281 环境配置:ubuntu 14.10 1.保存下述代码为 sublime_imfix.c 文件 /* s ...

  7. 允许Sublime编辑器在Ubuntu上输入中文

    Sublime Text是一款功能非常强大的轻量级代码编辑器,有关功能介绍和使用可以看我另一篇文章的描述http://www.cnblogs.com/jaxu/p/5037547.html 不过,在U ...

  8. PhpStorm 2016.3 For Mac 重大里程碑更新 -- 终于解决了不能输入中文标点符号的重大bug

    PhpStorm 2016.3 For Mac 重大里程碑更新 1.[终于解决了]不能输入中文标点符号的重大bug,如 逗号“,”.“.”: 2.可以在一个窗体中,同时打开多个项目: 3.其他... ...

  9. 关于Qt creator 无法使用fcitx输入中文的问题折腾

    环境: 系统ubuntu16.04amd64,qt5.4.2 安装完qt5.4后,在编写代码时,发现无法输入中文,离开qt creator 就立刻正常.原因似乎是qt对fcitx支持. 解决方法我是参 ...

随机推荐

  1. django提供xml下载

    def test_file_download(request): wb = export_to_xls() response = HttpResponse() response['Content-Ty ...

  2. C Primer Plus(第五版)1

    这是C Primer Plus(第五版)的第一章,上传上来主要是方便我进行做笔记,写注释,还有我会删掉一些“废话”等. 1.1 C语言的起源 贝尔实验室的 Dennis Ritchie 在1972年开 ...

  3. Jquery 对象转json ,Json转对象。兼容浏览器。

    引入jquery 转json库 [ 文件大小为2.2K] <script type="text/javascript" src="https://jquery-js ...

  4. Arch时间校准

    sudo ln -s /usr/share/zoneinfo/UTC /etc/localtime sudo hwclock --systohc --utc sudo timedatectl set- ...

  5. 中南大学第一届长沙地区程序设计邀请赛 To Add Which?

    1350: To Add Which? Time Limit: 1 Sec  Memory Limit: 128 MB Description There is an integer sequence ...

  6. MFC学习 文件操作注册表操作

    c读写文件 void CFileView::OnRead() { FILE *pFile = fopen("1.txt", "r"); /*char ch[10 ...

  7. J1签证办理全过程

    从3月底开始申请,整理J1的材料,一直到现在VISA的status变成了issued,中间被check了20多天,终于快要可以去silicon valley了. 废话不多说,J1签证很easy,不要有 ...

  8. 使用pscp实现Windows 和 Linux服务器间远程拷贝文件

    转自:http://www.linuxidc.com/Linux/2012-05/60966.htm 在工作中,每次部署应用时都需要从本机Windows服务器拷贝文件到Linux上,有时还将Linux ...

  9. http是什么?

    http HyperText Transfer Protocol 超文本传输协议,是一个应用层通信协议. 可以用wireshark抓取.

  10. MySQL常用命令(待更新)

    1.登录到mysql:mysql -hlocalhost -uroot -p2.创建数据库:create database:3.使用数据库:use database:4.创建表:人员:qacreate ...