如何将新按钮添加到TextBox控件中 [英] How to add a new Button into the TextBox Control
本文介绍了如何将新按钮添加到TextBox控件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮帮我.
如何将新按钮添加到TextBox控件中?
如果单击该按钮,系统将显示一个新的筛选器"窗口?
如果您知道如何达到要求,请告诉我.
谢谢
Hi,
Please help me.
How do I add a new Button into the TextBox Control?
If you click the button the system will show a new Filter Windows?
If you know how to achieve the requirement, please let me know.
Thanks
推荐答案
您可以像这样在文本框中添加现有按钮.
You can add existing button in textbox like this.
Button Button1 = new Button();
Button1.Dock = Forms.DockStyle.Right;
TextBox1.Controls.Add(Button1);
您必须根据需要绑定按钮的事件.
You have to bind button''s event as required.
Button1.Click += new EventHandler(this.Button1_Click);
一个问题:这种方法可能会在按钮后面隐藏一些文本.最好将它们并排放置.
One problem: Some text may hide behind button with this approach. Better you place both side by side.
一种推测性的方式...您可以将TextBox和Button放入UserControl,更改其大小和位置,然后编写诸如"public"之类的内容事件EventHandler"...
A speculative way...you can put a TextBox and Button into a UserControl, change the size and location of it then write some thing like "public event EventHandler"...
这篇关于如何将新按钮添加到TextBox控件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文