all groups > dotnet compact framework > september 2003 >
You're in the

dotnet compact framework

group:

BUG in CF? creating button on runtime , but no text is set???


BUG in CF? creating button on runtime , but no text is set??? Michael Daniels
9/30/2003 6:51:57 PM
dotnet compact framework:
Hi NG:

this code works on a desktop

it also works on a Windows ce Maschine BUT their is no text on the button???

Am I doing something wrong or is it a bug?

Regards Michael

public Form1()

{

//

// Erforderlich für die Windows Form-Designerunterstützung

//

InitializeComponent();

for(int i = 0; i < 5 ; i++){

System.Windows.Forms.Button button = new Button();

button.Parent = this;

button.Text = "Test";

button.Location = new System.Drawing.Point(0,i * 40);

button.Size = new System.Drawing.Size(100,40);

}

}

Re: BUG in CF? creating button on runtime , but no text is set??? Alex Feinman [MVP]
9/30/2003 9:05:29 PM
Instead of setting button.Parent, try using this.Controls.Add(button)

[quoted text, click to view]

AddThis Social Bookmark Button