Hi,
I want to add textboxes and labels at runtime. Controls are to be added according to the value entered in textbox.
txtfamily is a textbox,in which user gives the no of familymembers.
i want to add age,gender,note s for each member.I have to repeat this process for total no of family members.
Iam trying this code below, please help me..iam not getting exactly what i wanted.
Private Sub txtfamily_TextC hanged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles txtfamily.TextC hanged
Dim tb As TextBox
Dim lb1 As New Label
Dim lb2 As New Label
Dim lb3 As New Label
lb1.Text = "Age"
lb2.Text = "Gender"
lb3.Text = "notes"
placeholder1.Co ntrols.Add(lb1)
placeholder1.Co ntrols.Add(lb2)
placeholder1.Co ntrols.Add(lb3)
Dim n As Integer = Val(txtfamily.T ext)
For i As Integer = 0 To n - 1
For j As Integer = 0 To 2
tb = New TextBox
Placeholder2.Co ntrols.Add(tb)
Next
Next
End Sub
1 2114
Hi,
I want to add textboxes and labels at runtime. Controls are to be added according to the value entered in textbox.
txtfamily is a textbox,in which user gives the no of familymembers.
i want to add age,gender,note s for each member.I have to repeat this process for total no of family members.
Iam trying this code below, please help me..iam not getting exactly what i wanted.
Private Sub txtfamily_TextC hanged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles txtfamily.TextC hanged
Dim tb As TextBox
Dim lb1 As New Label
Dim lb2 As New Label
Dim lb3 As New Label
lb1.Text = "Age"
lb2.Text = "Gender"
lb3.Text = "notes"
placeholder1.Co ntrols.Add(lb1)
placeholder1.Co ntrols.Add(lb2)
placeholder1.Co ntrols.Add(lb3)
Dim n As Integer = Val(txtfamily.T ext)
For i As Integer = 0 To n - 1
For j As Integer = 0 To 2
tb = New TextBox
Placeholder2.Co ntrols.Add(tb)
Next
Next
End Sub
now what's the problem?? are the textboxes generating...?? ? what are you getting....??? if the positioning is not OK then specify the location of newly created boxes..
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Stephen |
last post by:
I have been getting on well with help from this forum trying to create an
array list and work with it. Everything is working fine apart from
displaying my array list items into the labels in my asp table.
The asp table has numerous rows and each row has a label item within it.
Im finding it impossible to get something to work which adds the newest item
in the array list to the next row in the asp table. the first time the
button is...
|
by: Paul Dunstone |
last post by:
Hi group
I am trying to add a custom attribute to all .NET elements such as
textboxes, labels, datagrids etc. I want to add an attribute called
'key'. I already have the code working for the key attribute (it is
used to localise text within the element) but .NET reports that the
attribute is not valid.
Although the code works I would prefer not to get the warning each
time myself or one of the other coders use the key attribute. Is
|
by: Dalan |
last post by:
I have been using a module for printing labels in Access 97, and
although it works fine, I would like to add a small enhancement to it.
The module allows for setting the number of labels to print and/or to
skip; however, the Cancel command button does not function, nor does
clicking the X-close. Clicking either one is the same as clicking the
OK button.
Since the module creates and displays the dialog box, I will need a
piece of code to...
|
by: DebbieG |
last post by:
I am creating a database for a small department in a university. Each
student in their database can have 2 mailing addresses. They wanted mailing
labels pulling just the 1st address. No problem.
However, now they want a second label for students that have a second
mailing address.
Any ideas of how I can accomplish this?
Thanks in advance for any help.
|
by: slylos |
last post by:
I've got a Windows form that has a TabControl. I add TabPages to this
TabControl at Runtime, along with two Textboxes and a button. The problem
I'm having is I can't figure out how to reference the Textboxes elsewhere
once they have been created. The TextBoxes are being named based on a
private global counter (i.e. TextBox tb = new TextBox(); tb.Name = "tb" +
(counter++).ToString();) They are being created in a private method called...
| |
by: Dany P. Wu |
last post by:
Hi everyone,
I created a page which contains a two-column table. The first column has a
bunch of labels, and the second a bunch of textboxes. Here's the code:
======================================================
Protected WithEvents Container As System.Web.UI.WebControls.PlaceHolder
Private Sub ConstructEditTable()
Container.Controls.Add(New LiteralControl("<table>" & vbNewLine))
|
by: Peter Stojkovic |
last post by:
I have some windows, which have a lot of Textboxes, labels and buttons.
How can i - in a simple way- make a print out of all these textboxes (
"input" of textboxes of course ), labels and .so.on.
Thanks fpr any help
Peter
|
by: Rohan |
last post by:
Hi There,
Is it possible to rotate or resize pictureboxes, labels, textboxes at runtime?
And I even wanted to make textbox and label controls Transperent ?
|
by: cindy2 |
last post by:
Hi everyone,
I have 4 textboxes on form1. On runtime the user will be asked to fill in names. After that, I want these names placed RANDOMLY on 4 labels (form2). How should I do that? I am trying it for ages but I still don't have a clue to get them random.
Please help me.
Cindy
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |