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支持. 解决方法我是参 ...
随机推荐
- 九度OJ1085
说起这个题呢,就不得不提一种快速求解幂的算法——反复平方法,可以在O(logn)的复杂度完成求幂运算.具体思路我不说,巫泽俊大神翻译的<挑战程序设计竞赛>P123对此有详细描述. 但仅知道 ...
- android github
Action Bars ActionBarSherlock Extended ActionBar FadingActionBar GlassActionBar v7 appcompat library ...
- [kuangbin带你飞]专题十二 基础DP1
ID Origin Title 167 / 465 Problem A HDU 1024 Max Sum Plus Plus 234 / 372 Problem B HDU 1 ...
- python3 pickle, json
pickle 有dump ,dumps ,load,loads等方法.区别在于dumps不会写入到文件. import pickle string = ['a', 2341, 'adsf'] p_st ...
- Android的消息处理机制,handler,message,looper(一)
当应用程序启动时,Android首先会开启一个主线程(也就是UI线程),主线程为管理界面中的UI控件.在程序开发时,对于比较耗时的操作,通常会为其开辟一个单独的线程来执行,以尽可能减少用户的等待时间. ...
- sublime text编辑器删除已安装的插件
1.ctr+shift+P,输入package2.查找remove package3.输入你要删除的package4.回车,OK
- [Golang]Go Packages
---------------------------------------------------------------------------------------------------- ...
- ubuntu 更新重启后 登录后 无法进入图形界面
切换到控制台然后看看-/.Xauthority的组属性是否正确,如果被改成root组了,就会造成不能登陆,你将其删除就ok了
- php接口post提交方法 。
方法一,用 file_get_contents function send_post($url, $post_data) { //$postdata = http_build_query($post_ ...
- Linux自动化安装cobbler
1介绍 1.1 PXE PXE技术与RPL技术不同之处为RPL是静态路由,PXE是动态路由.RPL是根据网卡上的ID号加上其他记录组成的一个Frame(帧)向服务器发出请求.而服务器中已有这个ID数据 ...