Foxtable(狐表)用户栏目专家坐堂 → 建议列属性中中文输入,设置为中文时,增加半角全角选项!


  共有11655人关注过本帖树形打印复制链接

主题:建议列属性中中文输入,设置为中文时,增加半角全角选项!

帅哥哟,离线,有人找我吗?
lin_hailun
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/10/10 14:31:00 [显示全部帖子]

 输入法全角和半角切换的快捷键是Shift+Space。

 即 Shift+空格
[此贴子已经被作者于2012-10-10 14:31:13编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
lin_hailun
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/10/11 12:03:00 [显示全部帖子]

 在网上拷了一段模拟按键的代码,模拟按下Shift+空格,放到事件里去可用。

Dim typeForKeywords As Type = Type.[Gettype]("System.Windows.Forms.SendKeys+KeywordVk[], System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")

Dim typeForKeywordItem As Type = Type.[Gettype]("System.Windows.Forms.SendKeys+KeywordVk, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
Dim objNewKey As Object = Activator.CreateInstance(typeForKeywordItem, "SPACE", &H20)

Dim typeForSendKeys As Type = Gettype(SendKeys)

Dim fieldForkeywords As System.Reflection.FieldInfo = typeForSendKeys.GetField("keywords", System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.GetField Or System.Reflection.BindingFlags.[Static])
Dim objKeys As Object = fieldForkeywords.GetValue(Nothing)

Dim typeForlistForKeyword As Type = Type.[Gettype]("System.Collections.Generic.List`1[[System.Windows.Forms.SendKeys+KeywordVk, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
Dim objForTmpKeyWords As Object = Activator.CreateInstance(typeForlistForKeyword)

Dim mi As System.Reflection.MethodInfo = typeForlistForKeyword.GetMethod("Add")

For Each var As Object In DirectCast(objKeys, Array)
    'list.Add(var);
    mi.Invoke(objForTmpKeyWords, New Object() {var})
Next

'list.Add(key);
mi.Invoke(objForTmpKeyWords, New Object() {objNewKey})

mi = typeForlistForKeyword.GetMethod("ToArray")
Dim objArray As Object = mi.Invoke(objForTmpKeyWords, Nothing)
fieldForkeywords.SetValue(Nothing, objArray)

SendKeys.Send("+{Space}")
[此贴子已经被作者于2012-10-11 12:03:52编辑过]

 回到顶部