虚拟键盘作为一种形式 [英] virtual key board as a form

查看:75
本文介绍了虚拟键盘作为一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我是c的新手#

请帮我解决以下问题


Que:


i有一个表单应用程序,只有几个按钮说app1上面

和另外两个表单应用程序,其中有文本框说app2和app3

现在我需要输入app2''s或app3的文本框使用app1上的那些按钮

我怎么知道哪个在app2和app3中是活跃的。

我怎么能告诉app1 abt哪个文本框是在活跃的应用程序中关注


提前感谢

Hello i am new to c#
please help me for the following problem

Que:

i have one form application with few buttons say app1 on it
and two another form application with textbox in it say app2 and app3
now i need to type in app2''s or app3 ''s textbox using those buttons on app1
how can i know which is active among app2 and app3.
and how can i tell app1 abt which text box is in focus in the active application

thanks in advance

推荐答案


如何让我的Form2对我的Form1上的某些内容做出反应?

如何让我的Form1控制我的Form2上的内容?
How do I get my Form2 to react to something on my Form1?
How do I make my Form1 control something on my Form2?



虽然你可以让Form1直接访问Form2上的项目,但这不是推荐的方法。它将两种形式紧密地联系在一起。如果在Form2中进行了更改,例如删除其中一个控件,则Form1中的代码会中断。

Form1最好引发一个事件,并让Form2包含自己的代码以便如何应对这个。这将Form2中的Form2和Form1中的Form1负责。

它使Form1幸福地无知Form2 - 以及一个日志组件 - 和一个进度组件,还有十几个可以订阅的小黑盒子对于Form1中的事件,所有没有Form1负责直接影响除自身以外的控件。
活动教程(包括Form to Form,与班级相同)


您的问题标题表示您正在尝试制作虚拟键盘。 这个收银机教程正是这样做的:它制作了一个虚拟数字键盘。唯一的区别是你需要另外100个键。

Although you can have Form1 directly access items on Form2 it isn''t the recommended way to go. It ties the two forms tightly to each other. If a change is made in Form2 such as removing one of the controls, then code in Form1 breaks.
It is better to Form1 raise an event, and have Form2 contain its own code for how to react to this. This places responsibility for Form2 within Form2, and Form1 within Form1.
It keeps Form1 blissfully ignorant of Form2 - and a logging component - and a progress component, and a dozen other little black boxes that can be subscribed to events in Form1, all without Form1 being made responsible for directly affecting controls other than itself.
Events tutorial (including Form to Form which is the same as class to class)

Your question title indicates you are trying to make a virtual keyboard. This tutorial for a cash register does exactly that: It makes a virtual numeric keyboard. The only difference is that you will need another 100 keys.


我的问题是这样的


i有两个不同的应用程序,如屏幕键盘和excel表格


我的问题是:
第一次申请:带数字按钮的表格。
第二次申请:每种形式都有很多texbox的形式。


现在我需要使用第一个应用程序用数字填充这些文本框


i want第一个应用程序将如何知道哪个表单具有光标的文本框以及如何将数据发送给它。我认为它需要知道win32 api调用和所有。我很不明白。你可以帮帮我吗。


提前谢谢
my problem is like this

i have two different application like on-screen keyboard and excel sheet

in my problem i have:
1st application: form with number buttons.
2nd application: few forms with many texboxes in each.

now i need to fill those text boxes with number using 1st application

i want to how will 1st application know which text box of which form is having cursor and how will it send the data to it. i think it require knowledge of win32 api calls and all. which i very little idea. can u help me out in this .

thanks in advance


你写的两个程序是什么?

如果是这样,你可以用一些方法编写代码,让两者相互沟通。
Are the two programs ones you have written?
If so, you can code in some methods for the two to communicate with each other.


这篇关于虚拟键盘作为一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆