C#设置输入法实例分析
作者:永远爱好写程序 时间:2022-07-07 14:30:05
本文实例讲述了C#设置输入法的方法。分享给大家供大家参考。具体如下:
private void Form1_Load(object sender, System.EventArgs e)
{ //获取输入法信息
//获取系统中已经安装的文字输入法
InputLanguageCollection MyInputs=InputLanguage.InstalledInputLanguages;
//将输入法的名称添加组合框中
foreach(InputLanguage MyInput in MyInputs)
this.comboBox1.Items.Add(MyInput.LayoutName);
//获取当前输入法信息
InputLanguage CurrentInput=InputLanguage.CurrentInputLanguage;
this.textBox1.Text=CurrentInput.LayoutName;
//获取输入法的语言区域
this.textBox3.Text=CurrentInput.Culture.DisplayName;
//获取默认的输入法信息
InputLanguage DefaultInput=InputLanguage.DefaultInputLanguage;
this.textBox2.Text=DefaultInput.LayoutName;
}
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{ //设置当前输入法
//获取选择的输入法
InputLanguage MyInput=InputLanguage.InstalledInputLanguages[this.comboBox1.SelectedIndex];
//设置当前输入法
InputLanguage.CurrentInputLanguage=MyInput;
//获取当前输入法信息
InputLanguage CurrentInput=InputLanguage.CurrentInputLanguage;
this.textBox1.Text=CurrentInput.LayoutName;
//获取输入法的语言区域
this.textBox3.Text=CurrentInput.Culture.DisplayName;
//获取默认的输入法信息
InputLanguage DefaultInput=InputLanguage.DefaultInputLanguage;
this.textBox2.Text=DefaultInput.LayoutName;
}
希望本文所述对大家的C#程序设计有所帮助。
标签:C#,输入法
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
SpringBoot+Prometheus+Grafana实现应用监控和报警的详细步骤
2023-10-02 06:40:26
![](https://img.aspxhome.com/file/2023/6/67486_0s.jpg)
Java多线程Callable接口实现代码示例
2021-08-06 14:29:01
怎样使用PowerMockito 测试静态方法
2022-06-18 08:28:59
![](https://img.aspxhome.com/file/2023/7/86777_0s.jpg)
Java中如何计算一段程序的运行时间
2022-12-17 10:52:06
springmvc与mybatis集成配置实例详解
2021-06-16 22:10:27
TC 集群Seata1.6高可用架构源码解析
2022-04-18 05:02:34
![](https://img.aspxhome.com/file/2023/1/75801_0s.png)
SQL+C#实现获得当前月的第一天与最后一天
2022-02-19 13:46:07
c# Selenium爬取数据时防止webdriver封爬虫的方法
2023-06-24 07:50:51
![](https://img.aspxhome.com/file/2023/7/59117_0s.png)
分析HashMap 的 JDK 源码
2022-01-17 06:29:54
![](https://img.aspxhome.com/file/2023/4/68164_0s.jpg)
Java Web程序实现返回JSON字符串的方法总结
2023-07-28 22:46:48
![](https://img.aspxhome.com/file/2023/9/66169_0s.png)
关于重写equals()方法和hashCode()方法及其简单的应用
2023-08-01 06:48:13
![](https://img.aspxhome.com/file/2023/5/57805_0s.jpg)
java GUI编程之paint绘制操作示例
2023-11-24 17:58:39
基于mybatis-plus timestamp返回为null问题的排除
2023-08-07 00:43:50
![](https://img.aspxhome.com/file/2023/6/92696_0s.png)
Java数据结构之链表、栈、队列、树的实现方法示例
2021-10-07 10:40:29
spring整合JMS实现同步收发消息(基于ActiveMQ的实现)
2022-06-09 06:00:36
![](https://img.aspxhome.com/file/2023/1/66701_0s.png)
Java Stopwatch类,性能与时间计时器案例详解
2023-07-24 04:08:50
深入探究Spring底层核心原理
2023-03-05 08:32:16
详解C#对XML、JSON等格式的解析
2022-06-04 22:45:50
![](https://img.aspxhome.com/file/2023/5/68615_0s.jpg)
引入mybatis-plus报 Invalid bound statement错误问题的解决方法
2021-06-01 14:28:00
![](https://img.aspxhome.com/file/2023/3/66253_0s.jpg)
elasticsearch java客户端action的实现简单分析
2022-04-25 05:39:45
![](https://img.aspxhome.com/file/2023/4/83424_0s.jpg)