I query a database and Post() individually each result that meets the criteria of my select statement, and write the results on screen. If my query returns 5 results, I have to individually send all 5 requests. What is the best way for me to send all 5 at the same time (or sequentially) and...
I re-read my post from last night and that is incorrect syntax in one location as well as iterating the index of my foreach loop not the index of the TLP...
I think I am following what you mean about using the reowindex of the TLP - but my syntax is still not thar.
Google helps :)
int...
Only increment the index if the textbox needs to be on a new line...
foreach (string label in c.LabelsNeeded)
{
//Adding in a label
Label lbl = new Label();
lbl.Name = "lbl_" + index;
lbl.Text = label;
lbl.AutoSize = true;
tableLayoutPanel1.Controls.Add(lbl);
//Adding in a textbox...
I currently had it set-up as to use a TLP, but when was unable to get the formatting exactly like I was after (with 2 textboxes on some lines, and only one on others) I thought I would reach out and see if 1) I was doing it properly and 2) if there was a better way to accomplish the same result.
I am want to (by any option from the toolbox) have 2 columns...1 with the field and 1 with answer. What I have trouble with is how to line-up the answer with the field when the field could have multiple answers. I want this output
field ---- answer
EmpID ID
Phone Phone1 Phone2...
I think I am confused then as to how to re-use this user control. Would I need to create a uc1, uc2, uc3 each time I need to add an instance to my form?
Asking since the code example you provided shows
uc1.MyLabel.Text
uc2.MyLabel.Text
One more question and I think I got this. How can I change the name on my user control of the label and text box at run time? I tried the below, but this does not change the names, and I verified this was the correct spelling & names
UserControl1 uc1 = new UserControl1();
label1.Text = "I...
Apalogies, that is not what I was after. I was just meaning that following the tutorial that JohnH linked over to, I didn't feel like I had a full understanding of how to create a re-usable set of a label and text box. Which is why I added the stackoverflow link so that if I was speaking...
Something like this user control would be sufficient but my coding skill level is way low...
c# - How to create many labels and textboxes dynamically depending on the value of an integer variable? - Stack Overflow
From that tutorial - It doesn't seem that would be a feasible solution for dynamically creating multiple labels with text boxes at run time.
I'll have to think of a different approach of how to do my coding and syntax if adding a label then adding text box is my best option.
How would I use flow direction to add them in pairs? The other option that seems feasible is to design a UserControl...am googling that one now.
EDIT ---
Is this a good tutorial on how to create a user control of a label & textbox...
A more experienced user will probably laugh at the predicament I have gotten myself into but here goes. I am dynamically creating labels on a windows form flow layout panel. Perfect, formatting properly, lining up properly hooray! Well....now I need to dynamically create a text box that will...
I know the syntax to create labels dynamically, but how can I control the positioning of labels so that they are created vertically down the page to look like such
label1
label2
label3
label4
label5
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.