一个NewBie问题 [英] A NewBie Question

查看:72
本文介绍了一个NewBie问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始自学C#,我被卡在了某个地方。这是代码。

Hi, I have just started learning C# on my own and I am stuck somewhere. Here is the code.

展开 | 选择 | Wrap | 行号

推荐答案

最简单的方法是采取来自按钮的代码并将其放在自己的方法中 - 我给了我的示例一个任意的导航名称,但是调用它你想要的,然后在文本框的TextChanged事件和按钮的Click事件中,你调用你的导航方法:

The most straightforward way is to take the code from your button and put it in its own method - I gave my example an arbitrary name of navigate, but call it what you want, then in the TextChanged event of your textbox and the Click event of your button, you call your navigate method:

展开 | 选择 | Wrap | 行号


我真的无法得到它,我猜你要做的是按下回车键,从文本框中调用按钮后面的代码。 rigth?
I really can''t get it, I guess what you are trying to do is to call the code behind the button from the textbox upon pressing the enter key. rigth?


或者你的意思是创建一个不同的例程,它可以在按钮点击和文本框的文本更改时调用。
or u mean to create a different routine which would be called both on button click and text change of the textbox.


这篇关于一个NewBie问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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