silverlight嵌套html不能输入中文问题
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不能输入中文问题的更多相关文章
- silverlight 不能输入中文问题
<param name="Windowless" value="true" />将调用silverlight页面的这句删除掉应该就能解决问题了 1. ...
- ios 一个正则表达式测试(只可输入中文、字母和数字)
一个正则表达式测试(只可输入中文.字母和数字) 在项目中碰到了正则表达式的运用,正则还是非常强大的,不管什么编程语言,基本上都可以用到.之前在用java时特别是对用户名或密码使用正则非常爽,写 脚本上 ...
- Debain下解决sublime无法输入中文
sublime安装的方法在此不做过多介绍,网上有很多中教程的方式.本文描述在已经安装sublime的前提下如何输入中文. 1.保存下面的代码到文件sublime_imfix.c(位于~目录) #inc ...
- xshell不能输入中文,显示为??
不知不觉间发现自己使用xshell的时候不能输入中文了,输入的中文会变成"??",开始以为是编码问题,看了一下编码设置后发现没有任何问题,而且显示中文没有出现乱码问题,只是在输入的 ...
- js控制文本框只能输入中文、英文、数字与指定特殊符号.
先在'' 里输入 onkeyup="value=value.replace(/[^\X]/g,'')" 然后在(/[\X]/g,'')里的 X换成你想输入的代码就可以了, 中文u4 ...
- sublime_text_2 ubuntu下无法输入中文 解决方法
参考资料:http://my.oschina.net/wugaoxing/blog/121281 环境配置:ubuntu 14.10 1.保存下述代码为 sublime_imfix.c 文件 /* s ...
- 允许Sublime编辑器在Ubuntu上输入中文
Sublime Text是一款功能非常强大的轻量级代码编辑器,有关功能介绍和使用可以看我另一篇文章的描述http://www.cnblogs.com/jaxu/p/5037547.html 不过,在U ...
- PhpStorm 2016.3 For Mac 重大里程碑更新 -- 终于解决了不能输入中文标点符号的重大bug
PhpStorm 2016.3 For Mac 重大里程碑更新 1.[终于解决了]不能输入中文标点符号的重大bug,如 逗号“,”.“.”: 2.可以在一个窗体中,同时打开多个项目: 3.其他... ...
- 关于Qt creator 无法使用fcitx输入中文的问题折腾
环境: 系统ubuntu16.04amd64,qt5.4.2 安装完qt5.4后,在编写代码时,发现无法输入中文,离开qt creator 就立刻正常.原因似乎是qt对fcitx支持. 解决方法我是参 ...
随机推荐
- JDK环境变量中dt.jar、tools.jar等变量值的作用
变量名:CLASSPATH 变量值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; tools.jar: 工具类 库,它跟我们程序中用到的 基础 ...
- JAVA中String与StringBuffer的区别
String和StringBuffer的区别,网上资料可以说是数不胜数,但是看到这篇文章,感觉里面做的小例子很有代表性,所以转一下,并自己做了一点总结. 在java中有3个类来负责字符的操作. 1.C ...
- HTTP权威指南之连接管理
TCP连接世界上几乎所有的 HTTP 通信都是由 TCP/IP 承载的, TCP/IP 是全球计算机及网络设备都在使用的一种常用的分组交换网络分层协议集. 客户端应用程序可以打开一条 TCP/IP 连 ...
- Codeforces 132E Bits of merry old England 【最小费用最大流】
题意: 让你输出长度为n的某个序列,然后给你m个变量. 每次给某个数赋值的代价是 假设赋值a=7那么代价是3,因为7的二进制位中有3个1. 要求最后总代价最小. 输出总共要进行操作的次数,和最小代价. ...
- poj 3259 Wormholes spfa算法
点击打开链接 Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 25582 Accepted: 9186 ...
- [POJ 1787]Charlie's Change (动态规划)
题目链接:http://poj.org/problem?id=1787 题意:有4种货币分别是1元,5元,10元,20元.现在告诉你这四种货币分别有多少个,问你正好凑出P元钱最多可以用多少货币.每种货 ...
- 常见的MIME类型
超文本标记语言文本 .htm,.html text/html 普通文本 .txt text/plain GIF图形 .gif image/gif JPEG图形 .ipeg,.jpg image/jpe ...
- Redis附加功能之键过期功能
一.键过期功能的相关命令 二.设置生存时间 Redis 提供了两个命令来设置键的生存时间(TTL,time to live),它们分别是: 如果给定的键不存在,那么 EXPIRE 和 PEXPIRE ...
- winform异步进度条LongTime
winform异步进度条LongTime,运用到回调函数 定义事件的参数类: namespace LongTime.Business { // 定义事件的参数类 public class ValueE ...
- 医失眠灵验方--五味子50g 茯神50g 合欢花15g 法半夏15g
方药:五味子50g 茯神50g 合欢花15g 法半夏15g 水煎服 主治:失眠健忘 此方为已故名老中医李培生之验方,用于临床治疗失眠健忘症,疗效显著,其主药为五味子,滋阴和阳,敛阳 ...