資源簡介
嚴格地講就是一個輸入窗。
這是自己寫的一個觸接屏鍵盤輸入法,支持中英文輸入。
全拼。 按鍵比較大。
不足之處是只能在程序中顯式調用 ,不同于其它輸入法,
適于不太頻繁調用的場合使用。
懶得改成其它方式了。
調用時就是一個函數,直接調用就行了。
目錄下有字庫文件,可以作為一個資源 打包(那是你的工作了),有問題請聯系我:qq: 183455715

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Drawing;
using?System.Data;
?
using?System.Text;
using?System.Windows.Forms;
using?System.Runtime.InteropServices;
namespace?BNHAccount?{
????public?partial?class?Keyboard_Panel?:?UserControl?{
????????public?Keyboard_Panel()?{
????????????InitializeComponent();
????????}
????????static?Keyboard_Panel??w?=?null;
????????public?static?void?Call(TextBox?edtPoint?LocationControl?parent){
???????????
????????????if(Keyboard_Panel?.w?==?null){
????????????????Keyboard_Panel?.w?=?new?Keyboard_Panel?();
????????????????Keyboard_Panel?.w.InitData();
????????????}
????????????Keyboard_Panel?.w.edtOuter?=?edt;
????????????Keyboard_Panel?.w.Parent?=?parent;
????????????w.Location?=?Location;
????????????w.Show();
????????}
????????private?void?pictureBox1_Click(object?sender?EventArgs?e)?{
????????????if(m_bShiftHolded){
???????????????SetStr(“!“);
????????????}
????????????else{
????????????????SetStr(“1“);
????????????}
????????}
????????Words_PinYin?m_obj?=?new?Words_PinYin();
????????public?void?InitData(){
????????????string?sPath?=?Application.StartupPath;
????????????
????????????if(sPath.LastIndexOf(@“\“)?!=?sPath.Length?-?1){
????????????????sPath?+=?@“\“;
????????????}
????????????m_obj.Build(sPath?+?“words.txt“);
????????}
????????TextBox?edtOuter?=?null;
????????
????????#region?
????????void?SetStr(string?s){
????????????string?sAlpha?=?“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ“;
????????????//是中文輸入并且是字母時輸入拼音框中
????????????if(m_bIsChinese?&&?sAlpha.IndexOf(s)?!=?-1){
????????????????SetStr(sedtPinYin);
????????????}
????????????else{
????????????????SetStr(sedtOuter);
????????????}
????????}
????????void?SetStr(string?sTextBox?edt){
????????????if(edt?==?null)?return;
????????????int????iIndex?=?edt.Selectionstart;
????????????string?sText??=?edt.Text;
????????????if(iIndex?>=?0?&&?iIndex?<=?sText.Length){
????????????????sText?=?sText.Insert(iIndexs);
????????????????edt.Text?=?sText;
????????????????edt.Selectionstart?=?iIndex?+?1;
????????????????edt.Focus();
????????????
????????????????
????????????}
????????}
????????void?CaretToLeft(TextBox?edt){
????????????if(edt?==?null)?return;
????????????int????iIndex?=?edt.Selectionstart;
????????????string?sText??=?edt.Text;
????????????if(iIndex?>?0?&&?iIndex?<=?sText.Length){
????????????????edt.Selectionstart?=?iIndex?-?1;
????????????????edt.SelectionLength?=?0;
????????????????edt.Focus();
???????????????
????????????}
????????}
????????
????????void?CaretToRight(TextBox?edt){
????????????if(edt?==?null)?return;
????????????int????iIndex?=?edt.Selectionstart;
????????????string?sText??=?edt.Text;
????????????if(iIndex?>=?0?&&?iIndex?????????????????edt.Selectionstart??=?iIndex?+?1;
????????????????edt.SelectionLength?=?0;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2010-11-18?10:45??Keyboard\
?????文件???????13571??2010-04-10?20:03??Keyboard\Keyboard_Panel.cs
?????文件???????73141??2010-04-10?10:15??Keyboard\Keyboard_Panel.Designer.cs
?????文件??????653459??2010-04-08?14:27??Keyboard\Keyboard_Panel.resx
?????文件?????????465??2010-11-18?10:36??Keyboard\vssver2.scc
?????文件?????????336??2010-04-10?10:15??Keyboard\wKeyboard.cs
?????文件????????3898??2010-04-10?10:15??Keyboard\wKeyboard.Designer.cs
?????文件??????232725??2010-04-08?22:14??Keyboard\wKeyboard.resx
?????文件???????15448??2010-04-10?10:15??Keyboard\wKeyboardInput.cs
?????文件???????74616??2010-04-10?10:15??Keyboard\wKeyboardInput.Designer.cs
?????文件??????653632??2010-04-08?11:24??Keyboard\wKeyboardInput.resx
?????文件??????161023??2010-04-07?13:37??Keyboard\words.txt
?????文件????????3305??2010-04-10?10:15??Keyboard\Words_PinYin.cs
?????文件?????????275??2010-11-18?10:47??Keyboard\新建文本文檔.txt
評論
共有 條評論