Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello All,

 

I have created an application that reads items from a database. What I want to do now is create an array of text boxes that are populated with the data retrieved from the database.

 

The problem is that I am unsure how to create an array of textboxes at runtime. I can use the .set_Size() method to place the box.

 

So far I have:

 

System.Windows.Forms.TextBox [] tbxResults = new TextBox[20];

while (myDataReader.Read())
{
		
tbxResults[loopControl] = new TextBox();
tbxResults[loopControl].set_Location(new System.Drawing.Point(8, y));
tbxResults[loopControl].set_Visible(true);
			
loopControl ++;
y += 24;
}

 

However the does not work.

 

Any help will be most appreciated

Harold Clements

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...