473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Create a textbox control array from sql table

OuTCasT
374 256MB
Hi.
I want to create an array that add's textboxes dynamically to a windows form according to an sql tables contents.

would this be possible ?
Jan 21 '09 #1
3 2223
OuTCasT
374 256MB
I was playing around and found that this would work.
Only one problem. How would i get the textboxes underneath each other instead of next to each other.

Expand|Select|Wrap|Line Numbers
  1.  
  2. For i As Integer = 0 To sqlDS.Tables("customers").Rows.Count - 1
  3. Dim tb As New Windows.Forms.TextBox
  4. With tb
  5. .Visible = True
  6. .Size = New Size(30, 30)
  7. .Location = New Point(40 * i, 40)
  8. .Name = "txtEarnings" + i.ToString
  9. MsgBox(.Name)
  10. .Text = sqlDS.Tables("customers").Rows(i).Item("customername")
  11. Me.Controls.Add(tb)
  12. End With
  13.  
Jan 21 '09 #2
debasisdas
8,127 Expert 4TB
you need to change the location property.
Jan 21 '09 #3
OuTCasT
374 256MB
yes thanks i did change the location.
Jan 21 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Karen | last post by:
I'm having trouble getting input from a textbox in Visual Basic 6.0 Private Sub cmdGetNumber_Click() txtInput.Text = Str(Int(1000 * Rnd)) End Sub The error message states: "Method or data...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
4
by: Andy | last post by:
I am attempting to print out a table using a repeater in which one field is updatable. Basically you would have a table of x number of rows and y number of columns. However: only one field in...
3
by: RSB | last post by:
Hi Every one Having tuff time creating web controls Dynamically. All i am trying to do is read a table and generate a list of ASP TEXT Box. So how do i create this Control dynamically and where...
5
by: Alex Nitulescu | last post by:
Hi. Because I'm a beginner in creating controls, I spent more than two *&^#$ hours to create this "login" as a custom control and to make it work properly: ...
4
by: Rich | last post by:
Hello, I have 3 textboxes and 1 combobox on a form. On entering the control I want to select all the text. I can make an array of textboxes like this: Dim arrTxt As TextBox() = {txt1, txt2,...
0
by: Sin Jeong-hun | last post by:
I need to create a table user control. The table will display many cells so this control requires scrollbars should be displayed when some cells cannot be displayed. At first, I draw the table on a...
8
by: nil | last post by:
Hello all, It's urgent... i want to add autocomplete textbox facility in my application like google. as you type it suggests option to the user..i want the same kind of facility...i know i...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
6
by: john | last post by:
I have the following textbox setup with Text & ToolTip Bindings as follows; I'm using Visual Studio 2008 VB: <asp:TextBox ID="txtDay1" runat="server" Text='<%# Eval("Day1") %>'...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.