cration of a new control, problem with adding new controls

פורום התמיכה לגרסה phpBB2. שימו לב - פורום זה הינו פורום ארכיון. התמיכה במערכת phpBB2 הופסקה.

מנהל: צוות האתר

beni_dude
משתמש חדש
משתמש חדש
הודעות: 1
הצטרף: 15/04/2008 ב-16:07:56

cration of a new control, problem with adding new controls

הודעה שלא נקראהעל ידי beni_dude » 15/04/2008 ב-16:42:59

Hello,
I have a problem when I try to add a new control to the panel control, I'm sure its a newbie problem but still I can't go around it!

What I'm trying to do is to create a new control which well be only one panel control and in it twelve text box (array of text box).

I'm also adding the code

קוד: בחר הכל

public partial class MonthPick : Control
{
public const int arrSize = 12;

public MonthPick()
{
InitializeComponent();

TextBox[] boxArr = new TextBox[arrSize];
initBoxArr(boxArr, arrSize);

//the problem is with the next line
panel1.Controls.Add = boxArr;
}

private void initBoxArr(TextBox[] boxArr, int arrSize)
{
for (int i = 0; i < arrSize; i++)
{
boxArr[i] = new TextBox();
}
}

protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}


}


I just don't know how to add the array of text box's

Thanks

The error that I receive is this:

Cannot assign to 'Contains' because it is a 'method group'

חזור אל “תמיכה - ארכיון”

מי מחובר

משתמשים הגולשים בפורום זה: אין משתמשים רשומים ו־ 131 אורחים

cron