开发者

Add instances of the Button to the form dynamically in monodevelop

I use MonoDevelop 2.4.2.1 on WinXP. I have a window with VBox and button 'MyButton'. Now I should write a method for 'MyButton' for creating other Button's instances dinamically开发者_C百科. I can't understand how to handle containers and widgets. Please give me advice how to do this.

Thanx!


You'll need to do something like:

myButton.Clicked += delegate {
    var nextButton = new Button ("Hello");
    box.PackEnd (nextButton, false, false, 0);
};

You can find GTK# tutorials at http://www.mono-project.com/GtkSharpTutorials and at http://zetcode.com/tutorials/gtksharptutorial/

In particular, I would suggest you read http://www.mono-project.com/GtkSharp:_Widget_Layout_and_Packing

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜