how to make Textboxes transparent?

How can I make a scrollable list of textboxes?

  • In my Winforms program the user chooses a combobox value of 2-16 and I would like to generate a corresponding number of textboxes when they press a button, preferably in a scrollable list to keep the form a smaller manageable size. Is this possible? For those suggesting a flowlayout, how would I add textboxes based on the number chosen in my combobox?

  • Answer:

    You can add the textboxes to a FlowLayountPanel. Make sure you set the AutoScroll property to true: private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { flowLayoutPanel1.Controls.Clear(); if (comboBox1.SelectedIndex == -1) return; int numberOfTextBoxes = int.Parse(comboBox1.SelectedItem.ToString()); for (int i = 0; i < numberOfTextBoxes; ++i) flowLayoutPanel1.Controls.Add(new TextBox()); }

Fuzz Evans at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

Add a FlowLaoyutPanel and when you click the button, add manually the textboxes to the FlowLayoutPanel

Juan Carlos Vega Neira

You can add your TextBoxes into a http://msdn.microsoft.com/en-gb/library/system.windows.forms.flowlayoutpanel.aspx and set its property AutoScroll to true.

cevik

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.